Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

javascript modules served with wrong MIME type

$
0
0
I'm trying to serve a javascript app with Nginx, which makes use of ES2016 modules. All of the module files have .the extension .js. When accessing the app from chrome, I receive the following error:

Failed to load module script: The server responded with a non-JavaScript MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.

I've tried including mime.types and making use of

types {
application/javascript js;
}

In my nginx.conf, neither has made a difference. How should I configure nginx to serve javascript module files with the appropriate MIME type?

Thanks,
howardd

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>