guardian / guardian/dotcom-rendering

Dev build: assets are loaded from absolute URL

Open
#9,678 0 comments 0 reactions 0 assignees View on GitHub
Team Candidate: WebX
Dominant language
TypeScript
Stars
274
Forks
34
Avg merge
2d 22h
Merged PRs (30d)
121

Description

When running the dev server, we serve assets from an absolute URL: `http://localhost:3030/path/to/asset.svg`.

This generally works fine, apart from when we use the Android emulator with local DCR. The Android emulator uses `10.0.2.2` to communicate with the host machine. For assets to work in the Android emulator, they should be relative or include the correct host (e.g `10.0.2.2:3030/path/to/asset.svg`).

We don't use relative asset loading because that breaks the case where a local Frontend renders articles with a local DCR.

https://github.com/guardian/dotcom-rendering/blob/ae15afb9cfd890b02885d59e93a4d51dd86ab996/dotcom-rendering/src/lib/assets.ts#L18-L37

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.