Refused to apply style from 'http://127.0.0.1:5500/website/display/style.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
When loading a CSS file I get an error like above, and the stylesheet doesn't load.
Mime type of the CSS file would be text/css instead of text/html. It might be a good idea to use the mime-type npm package to dynamically assign the style.
The type was text/html because that was a 404 error. My bad 馃
For unsupported stylesheet MIME type error. Please check the network tab. This usually happens when there is a typo in file/path name. The browser gets 404 error in response which cannot be applied like css.
Another thing to keep in mind: after you fix the path, you might need to do a hard reload in your browser (ctrl/cmd+shift+R in Chrome) to bypass cache.
Most of the time people get CSS MIME error could be because of the wrong path of css file in your code
I renamed style.css with styles.css
Problem solved for me.
Thank you @krupenja your comment saved me
Most helpful comment
Update
The type was text/html because that was a 404 error. My bad 馃