Mime type error when adding a CSS file to Angular

后端 未结 9 825
野的像风
野的像风 2020-12-20 11:36

I\'m trying to build a static site using Angular. What I want is to have some global css/js/image files to be added to the index.html

This is my code in

9条回答
  •  执笔经年
    2020-12-20 11:46

    I had the same issue when I have installed material-icons using npm i -S material-icons from the terminal.

    I have followed the instructions given in the npm package installation and have placed a link in the index.html like

    It has thrown a its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

    You have to actually paste the path mentioned in href in angular.json file under styles array

    Don't forget to restart the angular server, you can thank me later

    FYI: Angular - V8.x, material-icons - V0.3.1

    Thanks

提交回复
热议问题