Angular - Refused to apply style from because its MIME type ('') is not a supported stylesheet MIME type
I t has been a while since the last time I did some web development using Angular. Today I had to troubleshoot an existing application, so I compiled the Angular code and opened my browser for a debugging session.
First thing I noticed however was that although the Javascript code was executed succesfully, no CSS styling was applied.
When I had a look at the browser errors I noticed the following error message:
Refused to apply style from 'https://localhost:3000/assets/styles/style.css' because its MIME type ('') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
Whoops! That was an error message that didn’t ring a bell.
The error turned out to be more scary than the root cause of the issue. It turned out that the path to the CSS file was incorrect and that a 404 response was returned from the server.
I fixed the path and could happily continue debugging…