guardian / guardian/dotcom-rendering
Dev build: assets are loaded from absolute URL
- 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
Assessment
This issue has not been assessed yet.