one-app icon indicating copy to clipboard operation
one-app copied to clipboard

one-app-dev-cdn does not check that remote module map fetch was successful

Open smackfu opened this issue 1 year ago • 1 comments

🐞 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

  1. Change the moduleMapUrl value to point to something that returns an HTML error response.
  2. 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.)

smackfu avatar Jul 25 '23 20:07 smackfu

This issue is stale because it has been open 30 days with no activity.

github-actions[bot] avatar Aug 25 '23 00:08 github-actions[bot]