-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
"Refused to apply style from ... because its MIME type" error #3168
Comments
Technically, a workaround would be removing hashes from bundle names in development (and it will also increase building speed) but I would really like to know what is going wrong here |
HMR and |
Duplicate webpack-contrib/mini-css-extract-plugin#444, nothing to fix here, I will fix it after webpack-dev-server stable release |
If anyone is facing the same issue using const isProd = process.env.NODE_ENV === 'production'
const isDev = !isProd
const filename = (ext) =>
isDev ? `bundle.${ext}` : `bundle.[fullhash].${ext}`
...
output: {
filename: filename('js'),
path: path.resolve(__dirname, 'dist'),
clean: true,
} |
Code
package.json, dependencies
Expected Behavior
webpack-devserver
updates the page on changesActual Behavior
webpack-dev-server
sometimes (usually after some amount of similar changes back and forth or a error in terminal) doesn't updatebundle.css
on changes in a*.scss
file. There is an error in devtools terminal:Refused to apply style from 'http://localhost:8080/bundle.827759789137d0c65a1e.css?1617926518186' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
Updating the page with F5 helps to load an actual version.
Apparently, a new style file was compiled on a change but html was not updated and
webpack-dev-server
tried to access not existing anymore style file.UPD
It also stops detecting changes in any other files... Or, to be more accurate, it does say in the devtools that an update is detected but nothing happens, the content of the page is not updated
The text was updated successfully, but these errors were encountered: