one-app
one-app copied to clipboard
one-app-dev-cdn does not check that remote module map fetch was successful
🐞 Bug Report
Describe the bug
one-app-dev-cdn uses fetch to load the remote module map from moduleMapUrl
but doesn't check that the fetch was successful before parsing the response. This leads to confusing JSON parsing errors if it was not successful and the error page was in HTML format.
warn: one-app-dev-cdn error loading module map from https://<redacted>/module-map.json:
FetchError: invalid json response body at https://<redacted>/module-map.json
reason: Unexpected token < in JSON at position 0
This is most likely to happen when there are proxy configuration issues.
To Reproduce
- Change the
moduleMapUrl
value to point to something that returns an HTML error response. - Start the server.
Expected behavior
one-app-dev-cdn should warn that the module map fetch fails.
(I actually think it should error and quit in this case but that is not how this code is currently designed.)
This issue is stale because it has been open 30 days with no activity.