sandpack
sandpack copied to clipboard
Service Worker registration failed (text/html)
Bug report
Packages affected
- [x] sandpack-client
- [x] sandpack-react
Description of the problem
console is showing an error since version 2.11.0
Service Worker registration failed: DOMException: Failed to register a ServiceWorker for scope ('https://2-11-2-sandpack.codesandbox.io/') with script ('https://2-11-2-sandpack.codesandbox.io/csb-sw.js'): The script has an unsupported MIME type ('text/html').
Pinning both the client and react pkg to 2.10.0 fixed the issue on our end.
Used here https://github.com/muxinc/media-chrome/pull/791
Repro here, error visible in the console https://media-chrome-docs-a1ftyhecw-mux.vercel.app/docs/en/get-started
+1
I've tried several times and have found a temporary solution for now. You can still use the latest version of @codesandbox/sandpack-react, but you'll need to additionally configure the package.json file, fixing the version of the @codesandbox/sandpack-client package at "2.10.0". I suspect that the issue is caused by the @codesandbox/sandpack-client package as it uses an independent version number and doesn't stay in sync with @codesandbox/sandpack-react, which depends on it. Therefore, the latest version of @codesandbox/sandpack-client directly causes the page to throw an error.
version:2.13.5
Facing this issue (same as @binghuis screenshot) still on "@codesandbox/sandpack-react": "^2.13.10"
Same error for latest version and whatever I do it still try to use: https://2-13-8-sandpack.codesandbox.io/
did not help to use resolutions
It's work for me. Many thanks
It worked for me after i hosted the bundler at a subdomain. My domain is https://frontend-challenges.com/
and I hosted the bundler at https://bundler.frontend-challenges.com
It has been fixed in the latest version. Sorry for the long wait!