-
Notifications
You must be signed in to change notification settings - Fork 12k
Bootstrap styles not loading #3411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@filipesilva Any idea? |
I'm using Bootstrap v4 with exactly this approach in beta.21 without any issue... |
I too. And when downgrade to bootstrap 3.3.7 - still work. |
I have the same problem with bootstrap v3.3.7. I use the same config like you and it doesn't work now. |
I'm facing the same problem with angular-cli: 1.0.0-beta.21, node 7.2.1 and 4.0.0-alpha.6. Bootstrap content is included in the generated styles.bundles.css file, but not available in the page |
I can confirm this behavior in 1.0.0-rc.0. I will try to create a reproduction and add it here, if I'm done. |
I found the problem in my case: If you try to use a bundle from a linked npm package it breaks, because webpack works with the absolute path of the files and so, the exclude options of webpack aren't working anymore. I'm not sure if this is an issue of webpack or not. There are more problems with linked projects, e.g. #5049, where this could be the reason of the failure. |
me also. the style is applied is i import bootstrap.css in styles.css. but i can not get it working in angular-cli.json > styles array. |
Closing as outdated. If this still happens, please let me know. |
I'm trying to follow a tutorial and I added the following to my
But bootstrap does not show on the page. Changing my index.html into this ugly mess works, but I'm pretty sure this webpack magic should handle it.
I also have |
@Zhuinden the example in https://github.com/angular/angular-cli/wiki/stories-global-lib is for Bootstrap 4, but you are using Bootstrap 3. |
I had this issue, then a good old exit and re-run of ng serve was all I needed to do. |
@filipesilva ,Could u pls check my issue #9690?i am also facing similar type of issue. |
I had the same problem with bootstrap 4. I uninstalled and installed version 3 and it worked |
Solution 1 (with Bootstrap installed)
"styles": [
Here is an awesome tutoral: https://www.youtube.com/watch?v=JYPyy-hvjYc&list=PL6n9fhu94yhXwcl3a6rIfAI7QmGYIkfK5&index=1#t=05m18s Solution 2 (with Bootstrap referenced)
@import url('https://unpkg.com/[email protected]/dist/css/bootstrap.min.css'); |
For me, I just added the following to my Angular-cli.json file, and it worked... remember, WebPack needs to know "where and what to include :) Be sure to restart "ng serve" |
Solution of manojsgh worked for me too. |
I have resolved this by reading the link provided by @filipesilva |
Thanks @alextait1 !! Your method worked for me....... |
Restart npm server |
Okay
…On Wed 2 May, 2018, 2:06 AM irfanakbar47, ***@***.***> wrote:
Restart npm server
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3411 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AYVbk57P9H1m-pwjj_ClfjoMvHXUa6onks5tuMdGgaJpZM4LEpPr>
.
|
restart the application using ng serve |
@alextait1 Works like a charm. Thank you so much :) |
manojsgh solution works for me, I was trying the filipesilva solution but wihout results. |
I ran into the same issue,Bootstrap was not loading with Angular 6, no matter how I tried to import , finally solved by downgrading bootstrap 4 to 3 |
add to styles.css |
I can confirm that this issue is because of bootstrap 4. I am using angular 6 and was trying to include bootstrap v4 it wasn't showing up and then I downgraded to bootstrap v3 and it works like a charm. Simply use the command |
try removing single dot (.). See below. This worked for me. |
Ran into the same issue and had to downgrade to version 3 of bootstrap and it worked. |
I also have the same issue, however I am using version 4.1.3 as I want to be up to date. (The instructor is still using 3.3.7) I am following a Udemy tutorial. In my angular.json, I have this: because at some point I would like the flexibility of .less. |
Downgrading to version 3 isn't a solution and is absurd. |
The only way I can get to use the version 4 + styles is to use a CDN link at the top of app\src\styles.css:
That's great when on occasions the bootstrapcdn server is down and all my users see an unstyled app - very professional. Could someone PLEASE explain why 4 + can't be used the same as 3.3.7 upwards, WHAT is broke and WHY ? |
https://www.techiediaries.com/angular-bootstrap/ That link should clear up a lot of confusion. |
Thank You so Much @dotNetAthlete, So cut to the chase, The only thing we need to do is to use the latest Bootstrap: P.S : Still need to Install bootstrap first :-) |
I checked all the options and tried each suggested here in the post. But only working option is by uninstalling 4.* version by (npm uninstall bootstrap --save) and next by installing bootstrap 3.3.7 (npm install [email protected] --save).. **
** for other advanced members/users who dont want to disturb their existing version they have to deal with some intricacies of how to deal with such issues (for e.g. popper.js, jquery.js versions etc) and also know how to map these with the current bootstrap version.. then it might work! but for me the priority to was to make my learning curve smooth and dont get mingled in these intricacies for now. all the best! happy coding. |
After installing the bootstrap dependency into your project just plug in the below code in your angular.json file. "styles": [ Using, Hope this is helpful! |
Had thesame problem. |
I had the same issue yesterday. I found a solution to it. I found the solution here https://stackoverflow.com/questions/51998505/styles-not-picking-from-angular-json-styles-array-angular-6-but-working-fine-wi |
don't work until downgrade , |
Just put "scripts": [ "styles": [ Hope that it would work :) |
same issue please let me know if any one getting solution. |
It happen to me today. Ubuntu, Angular 8, Bootstrap 3. |
I'm inputting all 3 scripts and the bootstrap styling inside the index.html, same error. |
Thanks i have the same problem and it's work now |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Hi,
I followed the steps for Global Library Installation https://github.com/angular/angular-cli#global-library-installation
Installed [email protected]
npm install bootstrap --save
Then added the needed script files to to apps[0].scripts in angular-cli.json file:
and the Bootstrap CSS to the apps[0].styles array:
But the bootstrap styles are not loading
OS- Windows 7 Enterprise
angular-cli: 1.0.0-beta.21
node: 6.9.1
os: win32 x64
The text was updated successfully, but these errors were encountered: