3

Getting error while loading css on angular5 with ngx-bootstrap

Refused to apply style from 'http://localhost:3000/node_modules/ngx-bootstrap/datepicker/bs-datepicker.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

i have include css only in index.html <link href="../node_modules/ngx-bootstrap/datepicker/bs-datepicker.css" rel="stylesheet"/>

2 Answers 2

1

You can also add the style in your .angular-cli.json, if you're using ng-cli. Then Angular CLI will take care of adding the file to index.html for you:

{
  ...
  "styles" : [
    "../../../node_modules/bootstrap/dist/css/bootstrap.min.css",
    "../../../node_modules/ngx-bootstrap/datepicker/bs-datepicker.css",
    "styles.scss",
    ...
  ],
  ...
}

Alternatively, if not angular-cli, then webpack can take care of this for you.

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

Comments

0

try adding the following inside of your link tag :

type="text/css"

Best regards

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.