0

I am getting below error in Console:

Refused to apply style from 'http://localhost:4200/bootstrap/dist/css
/bootstrap.css' because its MIME type ('text/html') is not a supported 
stylesheet MIME type, and strict MIME checking is enabled. webpack-
internal:///../../../core/esm5/core.js:3857 Angular is running in the 
development mode. Call enableProdMode() to enable the production mode. 
localhost/:1 Refused to apply style from 'http://localhost:4200/bootstrap
/dist/css/bootstrap.css' because its MIME type ('text/html') is not a 
supported stylesheet MIME type, and strict MIME checking is enabled.

Below is the code that I use to add Bootstrap:

npm install [email protected] --save

and then I add the path of bootstrap.css file:

path(/bootstrap/dist/css/bootstrap.css)

in style.css file

Note: My server is running but I am not able to use bootstrap.

1 Answer 1

1

You actually should add it to your .angular.cli.json list this

  "styles": [
    "../node_modules/bootstrap/dist/css/bootstrap.min.css",
    "styles.css"
  ],

Here is a source with more detail Source

Sign up to request clarification or add additional context in comments.

2 Comments

Is bootstrap in the node_modules directory? If you ran the install in a different location it could have been installed in a different directory. Make sure that it is present in <projectroot>/node_modules/bootstrap
Can you post your ‘.angular.cli.json’ file and your project file structure?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.