-
Notifications
You must be signed in to change notification settings - Fork 12k
angular-cli.json styles/scripts block do not load css/js file #2843
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
Just tried to reproduce this and everything worked. I followed the instructions in https://github.com/angular/angular-cli#global-library-installation, which are for Bootstrap 4. Then added Could see the Bootstrap 4 button and header font: I don't know what's happening in your setup, but my recommendation is to start a new beta.18 project and trying to follow those instructions as well. |
I'm seeing this issue as well. I was actually building a document of steps from beginning to end, to teach my team Angular2. I've provided the steps below. I did however, uninstall Node.js 6.5 before installing 7.0.0. All of this was performed today.
npm install –g typescript
npm install –g angular-cli
cd c:\prototype\angular2\
ng new CoolApp
cd CoolApp
npm install
npm start
npm install --global --production windows-build-tools
a. Run Command |
I apologize, it wasn't CLI not loading the CSS file. It was something with the bootstrap packages I was using. I switched to using The internets is full of the wrong way to do things. |
This issue is still happening with beta-21 ! See #3284 |
Getting the same trying to put ng2-bootstrap. Did someone has got a solution? Thanks |
Try out my solution if it works fine for you: then add the path in the styles array of .angular-cli.json an it will look likes this:
after that stop the local server of your angular project and start it again, In simple words I hope this will work for you. Have a nice day :) |
I am having the issue as well. it works if i import the bootstrap in src/styles.css. But it just will not working if i put in under angular-cli.json > styles.. so sad.. i am using rc1 |
Is there any ways to auto inject all the css files from a folder?
or
|
@maxguzeng This can be a mistake of file paths. Check every styles file which in your .angular-cli.json file to make sure they are exactly in the right paths. I just fixed my project. |
@FlappyHeart I am pretty sure I got the path right, since I saw the 3.3.7 bootstrap compiled in bundle. but the style is not applied. and i update the bootstrap version to 4. everything work. I have been debugging this for 2days and a few others found the same problem with rc0 and rc1 |
upgrade to rc2 seem to solved my problem. One other reason might be i am using Chinese npm mirror so called cnpm. Sometime it have unpredictable error even it promise it should function with no potential problem...sad face. |
Make sure you are modifying **.**angular-cli.json file in the root dir! .angular-cli.json instead of angular-cli.json in node-modules dir. The app will configure according to .angular-cli.json in the root dir. |
Hi! I have added the css and js in root folder of angular-cli.json for angular2-perfect-scrollbar (https://www.npmjs.com/package/angular2-perfect-scrollbar) and it looks like : "styles": ["../node_modules/angular2-perfect-scrollbar/dist/lib/perfect-scrollbar.component.css"], But I was unable to get the css style and getting normal scrollbar. Can anyone help me? |
My team is having the same problem as trifan84. CSS is injected into styles.bundle.js, but is never exported (injected into head tags). |
Using the @import in the styles.css worked for me. |
Our issue ended up being using symbolic links on Windows. |
Same problem here, i can see bootstrap loaded in bundles, but not loaded into html. I am using latest beta bootstrap. edit i jsut installed [email protected] and it works ok |
I just had this same problem. The only change I made was @sikemullivan's suggestion to use "npm install bootstrap@next --save" instead of just "npm install bootstrap --save" Can someone explain why on Earth that would be necessary? Now my package.json lists the following "dependencies": "@ng-bootstrap/ng-bootstrap": "^1.0.0", Whereas earlier it only had bootstrap 3.x.y. Why doesn't ng-bootstrap explain some of this under their "install" page? |
I also have the same problem here is a segment of my .angular-cli.json
Using this configuration does not import the necessary files, however when I import the botchat.css and botchat-fullwindow.css on styles it is working but I want to utilize the .angular-cli.json file. May I also ask where to import the script is it only to the index.html file? |
in my case it was just restart the server |
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 |
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. |
OS?
angular-cli: 1.0.0-beta.18
node: 6.9.0
os: linux x64
Versions.
angular-cli: 1.0.0-beta.18
node: 6.9.0
os: linux x64
Repro steps.
add bootstrap css file like this
and run ng serve
all pass no error
style.bundle.js has load ,but not inject style element into HTML
The log given by the failure.
no error info
Mention any other details that might be useful.
same as scripts block
has load script.bundle.js but not work
If i remember correctly, beta17 still working
The text was updated successfully, but these errors were encountered: