Error in multi styles
OS?
Windows 7 x64
Versions.
Please run
ng --version. If there's nothing outputted, please run in a Terminal:node --versionand paste the result here:
angular-cli: 1.0.0.-beta.15 node: 4.4.7
Repro steps.
The app was created with angular-cli: ng new I added semantic.min.css under src/assets folder
in angular-cli.json, "apps" : [ { "styles": [ "../src/assets/sematic.min.css", "styles.css" ], } ]
The log given by the failure.
run: ng serve
ERROR in multi styles
Module not found: Error: Can't resolve 'c:\working\ng2\reddit\src\assets\sematic.min.css' in 'c:\working\ng2\reddit\node_modules\angular-cli\models'
@ multi styles
Mention any other details that might be useful.
Thanks @anmolsrepo .
Need fix it in angular-cli ?
I face the same problem, works well when change the file in angular.json, but would be good If this file generated by angular-cli.
Does anyone have the solution to this problem? Older version works fine but not this 7.3
I had issue when I newly create project while serving it. Error was ERROR in multi ./styles.sass
Just renamed all "styles": [ "src/styles.sass" ]to "styles": [ "src/styles.scss" ]in angular.json file because main css file was style.scss
Also, verify that "styleext": "scss" in angular.json under the app's schematics section.
A friend of mine had it set to "sccs", and wasted an hour chasing down the solution.
I try this and it works for me "styles": [ "./node_modules/bootstrap/dist/css/bootstrap.min.css", "./src/styles.scss" ],
Can anybody help me with this? ERROR in multi ../node_modules/aos/dist/aos.css ./src/styles.css Module not found: Error: Can't resolve 'C:\node_modules\aos\dist\aos.css' in 'C:\Angular6Project'
I included aos for animation and sliding and it was working fine. But on the very next day this issue appeared.....
Here is what I did to make it work!
- find "styles": [] in angular.json file.
- delete "../node_modules/bootstrap/dist/css/bootstrap.min.css",
- change "/src/styles.css" to "src/styles.scss",
- change file "styles.css" to "styles.scss"
Here is what I did to make it work!
- find "styles": [] in angular.json file.
- delete "../node_modules/bootstrap/dist/css/bootstrap.min.css",
- change "/src/styles.css" to "src/styles.scss",
- change file "styles.css" to "styles.scss"
Thank you so much
I think it is because of the problem with bootstrap, try this: Step 1. Inside .angular-cli.json file
"styles": [ "styles.css", "../node_modules/bootstrap/dist/css/bootstrap.min.css" ]
Remove "../node_modules/bootstrap/dist/css/bootstrap.min.css"
Step 2. Go to styles.css
Import bootstrap by adding this line @import "~bootstrap/dist/css/bootstrap.css";
These steps solved the errors I got during the building process.
It worked. Thank you
Paths in
angular-cli.jsonare relative to the project root (src/normally). For instance, you have thesrc/styles.cssfile, but inangular-cli.jsonit's listed only asstyles.css.
Angular 7 needs style file’s relative path from main project folder, so in
angular.jsonmake sure all references tostyles.scssincludesrc/:"styles": [ "src/styles.scss" ],Moreover, when you reference a npm package css/scss files in your
styles.scssdo it with~like so:@import '~font-awesome/scss/font-awesome';
This is a breaking change...
I had the same issue with a brand new angular 7 project. Just Installed it, npm start and got the error: ERROR in multi ./src/styles.sass
So I opened angular.json and:
"styles": [
"src/styles.sass" <-- I had styles.scss file, not this styles.sass
],
I just renamed styles.sass to styles.scss because that file was present in the project folder and npm start again. This resolved my issue.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.