Breaking News

Sharepoint: Refused to apply style from import because its mime type text/html is not a supported stylesheet mime type and strict mime checking is enabled

One of my Sharepoint sites stopped importing the styles from the CSS stylesheet. I got this error in the console:

Refused to apply style from import <url> because its mime type text/html is not a supported stylesheet mime type and strict mime checking is enabled

I stripped the stylesheet of all comments, changed the type to ‘text/html’, and switched out the file. None of that worked.

However, when I uploaded the new file and copied the URL over to the script web part, it worked. Turns out the link was pointing to an old version of the site that had been at a different URL location. Evidently that old site was deleted and the CSS removed, so when the import searched for it, it returned an HTML error page not found, which is of course and HTML MIME type!

 

Related Post