You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Playground from dev server does not load in Firefox #1196
When using npm run dev, Firefox 115.9.1esr is unable to load Playground from http://localhost:5400/website-server/.
It starts loading but fails with the error:
TypeError: ServiceWorker script at http://localhost:5400/service-worker.ts?type=module&worker_file for scope http://localhost:5400/ threw an exception during script evaluation.
Here's a full screenshot:
I am unable to get further information on the error, but I believe the error is likely due to the fact that Firefox does not support ES modules as ServiceWorker scripts. See the support matrix on MDN.
Interestingly, Playground from playground.wordpress.net loads fine in Firefox . There we are still registering the ServiceWorker with type: "module", but https://playground.wordpress.net/sw.js does not appear to have any module-related syntax. A snapshot of the current, transpiled sw.js content can be found here.
Perhaps Firefox's lack of ServiceWorker module support is also causing #1180.
Activity
bgrgicak commentedon Apr 5, 2024
This could be resolved by #1086
I was able to get it to work in another project that uses Vite, but it required rewriting the SW registration to work with Vite PWA.
brandonpayton commentedon Apr 11, 2024
Thank you for mentioning that @bgrgicak. Is it possible that our PWA work may help us solve this for "free"?
Closing this issue as a duplicate of #330.