Good day,
I have a basic react project which I am serving from a Django app. I have a vanilla react (dev) environment setup using babel, webpack. Webpack generates a "main.js" file which is referenced in my index.html enclosed in script tags with type "application/javascript".
When running the app locally I have no issues or warnings.
When deploying to pythonanywhere (firefox) I get: "Refused to execute script from 'https://scorescr.pythonanywhere.com/static/main.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled."
I am guessing that the issue is to do with the fact that I am serving the file from the web app itself and returning a mime type of html. (Opera and safari produce similar errors).
Can one configure webpack to set a mime type for the file ? (I cant find any info on this), OR, Do something in django to serve the file with the mime type "application/javascript", OR, am I just missing something really obvious...
Any advise would be appreciated. Thank you.