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
SecurityError: Failed to register a ServiceWorker for scope ('my_domain.../') with script ('my_domain.../sw.js'): The script has an unsupported MIME type ('text/html').
I have done extensive research and found that other people have encountered the same issue with CRA, but I'm having trouble understanding what to do with Next. I have several clients who are unable to install the PWA due to this error, mostly on mobile devices. What's interesting is that some of them are up to date and should support PWAs.
Versions
"next": "^13.3.4",
"next-pwa": "^5.6.0",
"react": "^18.2.0",
How To Reproduce
I couldn't reproduce it in a controlled environment. It's happening on multiple people's devices. I'm able to capture the exceptions with Sentry, and when I analyze what people are seeing on Hotjar, they're indeed unable to install the app.
Steps to reproduce the behavior:
Apparently, customers access the website, and during the script loading, the browser already raises this exception.
Expected Behaviors
It should be possible to register the service worker.
Screenshots
😢
Any ideas on where should I start to solve this?
The text was updated successfully, but these errors were encountered:
I found this issue #479
Maybe?
I'm not sure if it's the same case, but there's a good chance it is.
I tried accessing the /sw.js file to see if it was there, and yes, it was. Everything works fine on the computer.
Summary
I caught this error on Sentry:
SecurityError: Failed to register a ServiceWorker for scope ('my_domain.../') with script ('my_domain.../sw.js'): The script has an unsupported MIME type ('text/html').
I have done extensive research and found that other people have encountered the same issue with CRA, but I'm having trouble understanding what to do with Next. I have several clients who are unable to install the PWA due to this error, mostly on mobile devices. What's interesting is that some of them are up to date and should support PWAs.
Versions
How To Reproduce
I couldn't reproduce it in a controlled environment. It's happening on multiple people's devices. I'm able to capture the exceptions with Sentry, and when I analyze what people are seeing on Hotjar, they're indeed unable to install the app.
Steps to reproduce the behavior:
Apparently, customers access the website, and during the script loading, the browser already raises this exception.
Expected Behaviors
It should be possible to register the service worker.
Screenshots
😢
Any ideas on where should I start to solve this?
The text was updated successfully, but these errors were encountered: