When I login in the URL of my application which is using angular JS in frontend and running on JBoss server, the JS and CSS files are loading with status 200 but still I am getting below error where the files are not getting executed, I have replaced the original URL with text URL for privacy purpose:
In chrome browser:
Refused to apply style from 'URL/bootstrap-glyphicons.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
Refused to execute script from 'URL/angular.min.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
In firefox browser:
The resource from “URL/bootstrap.min.css” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
The resource from “URL/angular-route.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
We are using web server between URL and App server where the headers are set. There the header X-Content-Type-Options: nosniff is set. I couldn't find any setting related to this at the app server level. I am not able to understand why the MIME type is getting returned as text/html. I have checked each resource in Network tab, there the content-type sometimes shows up as application/javascript; charset=UTF-8 for JS files and sometimes it shows up as text/html; charset=UTF-8
Please check the file path is correct and files are exist, in my case that was the issue, As i fixed it and the error was disappeared. Hope it will work for you too.