Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS Mime type error #197

Closed
dominik-korsa opened this issue Sep 10, 2018 · 8 comments
Closed

CSS Mime type error #197

dominik-korsa opened this issue Sep 10, 2018 · 8 comments

Comments

@dominik-korsa
Copy link

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
@dominik-korsa
Copy link
Author

Update

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

@rajeev14ranjan
Copy link

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.

@IgorKrupenja
Copy link

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.

@Arnoldmn
Copy link

Most of the time people get CSS MIME error could be because of the wrong path of css file in your code

@idileepd
Copy link

I renamed style.css with styles.css
Problem solved for me.

@bertil291utn
Copy link

bertil291utn commented Aug 14, 2020

Thank you @krupenja your comment saved me

@harishs3
Copy link

i changed from style.css to styles.css and did a hard reload and tried downloading the npm mime-type package and nothing is still working. the same is happening when I put app.js in the source code. any help?

@maulidailham
Copy link

no no no, i got this with RIGHT path, why is it closed? because OP too dumb?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants