Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular unable to locate stylesheet warning

I have get a warning like this

Warning: Unable to locate stylesheet: D:\Angular\certification\Angular8Certification\https:\stackpath.bootstrapcdn.com\bootstrap\4.4.1\css\bootstrap.min.css     

I am new to Angular. When I add css It did not apply. What is the reason and what should I want to do?

Here is my console enter image description here

like image 786
Samanthika Rajapaksa Avatar asked May 14 '21 16:05

Samanthika Rajapaksa


People also ask

Why am I getting httpclient module not imported error in angular?

This error tells you, that you have not imported the angular HttpClient Module into your (root) module. To resolve the problem, you need to import the missing module into your module. Most of the cases, that module would be the AppModule in your app directory.

Can I use Angular Material with the CLI?

I created an Angular project using the CLI. I’m using SCSS, and I included Angular Material with a custom theme iirc. I added a couple dummy components, and the app still built fine. Then I needed to style my components using Angular Material.

Why does my angular app crash when I try to use JavaScript?

The most common reason, is, that the browser has not finished creating it and has not yet added it to the DOM. If you try to use it before it has been added, it will not work and crash your app. If you are familiar with JavaScript in general, you have probably stumbled across that problem, as it is not specific to angular.

Is the development process with angular painful?

Especially when you are a beginner, these problems can turn the development process with angular into a real pain. But trust me, it does not have to be painful. In fact, I think angular development is one of the smoothest development experience I had so far.


1 Answers

Edit:

This warning is caused by new update in polyfills.

Solution is:

  1. Remove all bootstrap cdn links from index.html

  2. Install bootstrap > npm install bootstrap

  3. Next, go the angular.json file and add the paths of Bootstrap CSS and JavaScript files to the styles and scripts arrays under the build target as follows: enter image description here

  4. ng serve --open again.

Result

enter image description here

This solution worked for me.

like image 100
Sujal Shah Avatar answered Nov 14 '22 22:11

Sujal Shah