question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CSS Mime type error

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

7reactions
dominik-korsacommented, Sep 10, 2018

Update

The type was text/html because that was a 404 error. My bad 🥇

2reactions
igor-krupenjacommented, Oct 16, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found