Welcome! Log In Create A New Profile

Advanced

javascript modules served with wrong MIME type

Posted by howardd 
javascript modules served with wrong MIME type
October 07, 2018 08:45PM
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
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 78
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready