ritwickdey / vscode-live-server

Launch a development local Server with live reload feature for static & dynamic pages.
https://ritwickdey.github.io/vscode-live-server
MIT License
5.67k stars 1.24k forks source link

Refused to apply style from 'http://127.0.0.1:5500/styles.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled. #382

Open PolygonCat opened 5 years ago

PolygonCat commented 5 years ago

We have written the needed data into your clipboard because it was too large to send. Please paste.

laclance commented 3 years ago

same error here

bmix commented 2 years ago

@laclance, @PolygonCat

EDIT: I have found a solution, at least for my issue: See this answer on Stack Overflow. It might be a 404 in disguise!

I leave my original topic-reply for reference:

I also experience this issue. The exact error message, I get, is:

Refused to apply style from 'http://127.0.0.1:5500/src/static/css/entry.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

This happens, when I try to transfer an XML file directly for display in the browser. It has a processing-instruction for the CSS like this:

<?xml-stylesheet type="text/css" href="../src/static/css/entry.css"?>

Runtime environment:

Version: 1.64.0-insider (user setup) Commit: b8178e3e2f3f620ebdd31dfbfba937ff1b12ee04 Date: 2022-01-28T10:16:39.172Z Electron: 13.5.2 Chromium: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Windows_NT ia32 10.0.19042 Browser: Vivaldi 5.0.2497.48 (Stable channel) (64-Bit)

This should be an easy fix, I would do it myself, if I'd know where to look out for it ;-)