Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service Worker registration failed (text/html) #1068

Open
2 tasks done
luwes opened this issue Jan 25, 2024 · 5 comments
Open
2 tasks done

Service Worker registration failed (text/html) #1068

luwes opened this issue Jan 25, 2024 · 5 comments
Labels
bug Something isn't working triage New issues that needs consideration

Comments

@luwes
Copy link

luwes commented Jan 25, 2024

Bug report

Packages affected

  • sandpack-client
  • 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').

SCR-20240125-pokw

Pinning both the client and react pkg to 2.10.0 fixed the issue on our end.

Used here muxinc/media-chrome#791

Repro here, error visible in the console
https://media-chrome-docs-a1ftyhecw-mux.vercel.app/docs/en/get-started

@luwes luwes added bug Something isn't working triage New issues that needs consideration labels Jan 25, 2024
luwes added a commit to muxinc/media-chrome that referenced this issue Feb 1, 2024
This change adds a docs examples page with Sandpack. 
The examples are pulled from the examples/vanilla folder.
This is just a start, would like to add more and more examples.

The HTML is editable and for the themes one can also edit the theme in
place and open it up in Sandbox for keeping their own copy for example.

The goal is to show off more with the cool things that can be easily
build with media-chrome and to be easier discoverable.


https://media-chrome-docs-git-fork-luwes-docs-upgrade-mux.vercel.app/docs/en/examples

---

Upgrades the docs dependencies and Astro to v4.

Vite has a regression which is reported here
vitejs/vite#15702 which Astro runs into
together with the React Sandpack library. So I pinned it to vite 5.0.10
to get around that.

Sandpack has a regression which I submitted an issue for here:
codesandbox/sandpack#1068

The rest seemed to work, a few more warnings in the CLI when building.
luwes added a commit to muxinc/media-chrome that referenced this issue Feb 1, 2024
This change adds a docs examples page with Sandpack.
The examples are pulled from the examples/vanilla folder.
This is just a start, would like to add more and more examples.

The HTML is editable and for the themes one can also edit the theme in
place and open it up in Sandbox for keeping their own copy for example.

The goal is to show off more with the cool things that can be easily
build with media-chrome and to be easier discoverable.

https://media-chrome-docs-git-fork-luwes-docs-upgrade-mux.vercel.app/docs/en/examples

---

Upgrades the docs dependencies and Astro to v4.

Vite has a regression which is reported here
vitejs/vite#15702 which Astro runs into
together with the React Sandpack library. So I pinned it to vite 5.0.10
to get around that.

Sandpack has a regression which I submitted an issue for here:
codesandbox/sandpack#1068

The rest seemed to work, a few more warnings in the CLI when building.
luwes added a commit to muxinc/media-chrome that referenced this issue Feb 1, 2024
This change adds a docs examples page with Sandpack.
The examples are pulled from the examples/vanilla folder.
This is just a start, would like to add more and more examples.

The HTML is editable and for the themes one can also edit the theme in
place and open it up in Sandbox for keeping their own copy for example.

The goal is to show off more with the cool things that can be easily
build with media-chrome and to be easier discoverable.

https://media-chrome-docs-git-fork-luwes-docs-upgrade-mux.vercel.app/docs/en/examples

---

Upgrades the docs dependencies and Astro to v4.

Vite has a regression which is reported here
vitejs/vite#15702 which Astro runs into
together with the React Sandpack library. So I pinned it to vite 5.0.10
to get around that.

Sandpack has a regression which I submitted an issue for here:
codesandbox/sandpack#1068

The rest seemed to work, a few more warnings in the CLI when building.
@binghuis
Copy link

binghuis commented Feb 5, 2024

+1

@binghuis
Copy link

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.

@binghuis
Copy link

image

@binghuis
Copy link

version:2.13.5
image

@hariria
Copy link

hariria commented May 1, 2024

Facing this issue (same as @binghuis screenshot) still on "@codesandbox/sandpack-react": "^2.13.10"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage New issues that needs consideration
Projects
None yet
Development

No branches or pull requests

3 participants