When on localhost the service-worker.js loads and works just fine, but on the live server it's not loading and I get this error in the console:
The script has an unsupported MIME type ('text/x-js').
Failed to load resource: net::ERR_INSECURE_RESPONSE
Uncaught (in promise) DOMException: Failed to register a ServiceWorker: The script has an unsupported MIME type ('text/x-js').
There is a redirect from http to https with a .htaccess which looks like this:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
- I know this has been asked before, but not fully answered.
 - I know it might have something to do with the .htaccess file like mentioned here.
 - It could also have something to do with the vue.js framework pointed out here
 
But in the end I can't get my head around this.
Any ideas?