-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
White page in production : the server responded with a MIME type of "text/html" #458
Comments
You must deal with this, you have 2 solutions:
There is nothing this plugin can do to resolve this issue, the decision is up to you. EDIT: you can also switch to custom service worker and use |
@emmanuelgeoffray you should check the cache headers you're using, just allow browser use it: https://vite-pwa-org.netlify.app/deployment/#cache-control |
I use the exact |
@emmanuelgeoffray upps,sorry man, the problem was about |
I'd agree with this change. I saw my users run into the same issue. |
@andr-ec we cannot change it, it is workbox internal, I'll check if we can detect it and throw an error if some variable enable (by default will be enabled, will throw if |
i saw this warning but i did nothing for it, i released version and now it's in production,and now i want to release new version , if i release new version i, my users will same the white screen because i face white screen in evaluation , how can i fix this problem and release new version? @emmanuelgeoffray |
also google cloud run has the same issue if you host it there. |
You can deploy a new version using a self destroying sw (copy/paste code snippet in the public folder using the current sw name), then change the |
This is a https://vite-pwa-org.netlify.app/guide/faq.html#missing-assets-from-sw-precache-manifest (You should check your app in your local via build + preview before setting the app to production using multiple builds with changes) |
I have faced this issue in pre-production: users have a white page and an error in console
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
I think this issue may take different form, depending on server response.
#457 may be related.
To reproduce:
clear the browser cache on the index.88888.js file
do a commit/push/deploy
return to the page
Explanation
What happens in the browser to generate this error:
The user ends up with a blank page To fix the problem, the user can do a clear refresh (Ctrl+Shift+R) to load the new index.html which calls index.9999.js which exists on the server.
Solution
To fix this on our side, we need to change the configuration so that index.9999.js and the following are always stored in the service worker cache.
Increase the size of
maximumFileSizeToCacheInBytes
to 3 MiB so that it allows caching of this file, according to the information in the doc.Suggestion
This bug can be very painful in production with users facing a 100% broken website.
This bug can be silent when doing tests and QA.
Once it is live, there is no way to fix it. The user is facing a white page and we can't tell him to clear refresh.
For me, I use netlify to build and deploy, and I did not check the warning in the build logs on netlify's website.
I'd suggest that this warning should be changed to an error, this would explicitly stop the build process, requiring developer to fix.
The text was updated successfully, but these errors were encountered: