For someone who faces the same problem.
The usual reason for this error message is that when the browser tries to load this resource, the server returns an HTML page, for example, if your router intercepts unknown paths and displays the default page without 404 error. Of course, this means that the path does not return the expected CSS file/image/icon/ whatever ... link from here
Suppose we have an Angular 6 project with a file structure like this
project |-src |-app |-assets |-environments |----
let's say that we need to put the folder with theming (which contains the themes) directly into the src folder.
project |-src |-app |-assets |-environments |-vendor // Theming |-theme-light.css |theme-dark.css
if we tried to access this theme file like this.
<link rel="stylesheet" type="text/css" href: '../vendor/theme-dark.css'>
This will give an error
Refused to apply the style from ' http: // localhost: 4200 / vendor / theme-dark.css ', because its MIME type ('text / html') is not a supported MIME type of the style sheet, and strict MIME checking is enabled.
If we skip this URL in the browser, this will not give a simple CSS file, because the path is incorrect.
Decision
So you need to find the right path. (we can find out by this url in the past and see what will be returned)
In this case, specifying ../src/ fix the error
<link rel="stylesheet" type="text/css" href: '../src/vendor/theme-dark.css'>
Note The exact path and configuration of the router depends on how you configured your project and what platform you are using.