Avoid Service Worker update issues on localhost - #1209
Conversation
|
Note: I do not know what |
|
Good fix @brandonpayton!
It's used for |
|
@brandonpayton I ran into that issue again on 127.0.0.1 – could be related to a stale service worker or could be an actual problem. Nothing actionable yet. Let's keep an eye on this. |
|
@adamziel I ran into the same yesterday. I thought maybe it had something to do with a stale worker originally registered under "localhost". Unregistering the service worker and reloading the page fixed the issue, which seemed different than @mho22's experience here: |

What problem is it solving?
This PR fixes #1180 - Playground on localhost sometimes fails to load due to failed service worker updates from "localhost".
How is the problem addressed?
By switching from "localhost" to the explicit loopback address "127.0.0.1". This avoids the case where "localhost" does not directly resolve to a loopback address.
For reference:
https://w3c.github.io/webappsec-secure-contexts/#localhost
Testing Instructions
Run
npm run devand confirm the new dev server URL ishttp://127.0.0.1:5400/website-server/and that local Playground loads successfully in your browser.