CSS Mime type error
See original GitHub issueI’m submitting a Bug report
Current behavior
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.
Expected
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.
Environment
- Chrome (desktop) version 69.0.3497.81
- Live Server: 5.1.1
- Platform: Windows 10 Home 64bit
- Visual Studio Code: 1.26
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7
Top Results From Across the Web
Stylesheet not loaded because of MIME type - Stack Overflow
js task compiles everything properly, but on the website, I'm unable to see any style, and the console shows this error message: Refused...
Read more >Solving the stylesheet not loaded because of MIME-type
Solving the "stylesheet not loaded because its MIME type is not supported" problem. The root cause is almost always the same.
Read more >Refused to apply style from <URL> because its MIME type ...
So css ,images ,etc are static files,if we try connecting css files using link it will cause MIME Error. Express serves them using...
Read more >Style.css error MIME - support - HUGO
Refused to apply style from 'http://localhost:1313/conseil-municipal/css/style.css' because its MIME type ('text/plain') is not a supported stylesheet MIME ...
Read more >MIME types (IANA media types) - HTTP - MDN Web Docs
A media type (also known as a Multipurpose Internet Mail Extensions or MIME type) indicates the nature and format of a document, file, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Update
The type was text/html because that was a 404 error. My bad 🥇
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.