Problem with service-worker

Not sure if anyone else having this issue: getting an error message in the console (Chrome)

The script has an unsupported MIME type (‘text/html’). service-worker.js:1
GET http://localhost:3000/service-worker.js net::ERR_INSECURE_RESPONSE service-worker.js:1

This is an old one, but perhaps my comments will be valuable to someone.

I too recently started seeing this unsupported MIME type error followed by the ERR_INSECURE_RESPONSE error. It was regarding sw.js

sw.js seems to be a Service Worker implementation by NitroBay:

I was able to resolve the error by following the advice offered by n3tr:

I can’t say what caused the problem, though it is easily resolved. I am also not sure why my app is even referencing sw.js, it is currently a bare minimal meteor and react learning experiment. Does Meteor use sw.js now?

TT

1 Like

I started getting this seemingly randomly having changed nothing in my code.
Turns out that I had run another app demonstrating a PWA with a service worker that I had cloned of github using “sw.js”. Chrome was trying to use the same service working since the domain was the same. Clearing stored files and app data in chrome fixed the issue for me.