angular-cli >= 1.0.1: File to import not found or unreadable: ~@angular/material/theming
See original GitHub issueBug, feature request, or proposal:
BUG
What is the expected behavior?
Angular CLI/Webpack should build without giving SCSS errors.
What is the current behavior?
Getting import unreadable for custom theming base scss file.
ERROR in ./~/css-loader?{"sourceMap":false,"importLoaders":1}!./~/postcss-loader?{"ident":"postcss"}!./~/sass-loader/lib/loader.js?{"sourceMap":false,"precision":8,"includePaths":[]}!./src/assets/styles/custom-app-theme.scss
Module build failed:
@import '~@angular/material/theming';
^
File to import not found or unreadable: ~@angular/material/theming.
Parent style sheet: stdin
in /Users/jason/web-app/src/assets/styles/custom-app-theme.scss (line 70, column 1)
@ ./src/assets/styles/custom-app-theme.scss 4:14-216
@ multi ./src/assets/styles/ptone.scss ./src/assets/styles/custom-app-theme.scss ./~/cropperjs/dist/cropper.css ./src/assets/styles/pace.css ./~/prismjs/themes/prism-okaidia.css ./src/styles.scss
webpack: Failed to compile.
What are the steps to reproduce?
Try to build project with custom material2 theme (importing ~@angular/material/theming) with angular-cli version >= 1.0.1.
Which versions of Angular, Material, OS, browsers are affected?
Angular 4.1.1 Angular-cli 1.0.1, 1.0.2 Material 2.0.0-beta.3
Is there anything else we should know?
Posting this here as well as in the angular/angular-cli repo https://github.com/angular/angular-cli/issues/6242. This could be an issue with the theming.scss and a new version of scss loader that angular-cli is now using.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:10
- Comments:9 (2 by maintainers)
Top Results From Across the Web
File to import not found or unreadable: · Issue #4038 - GitHub
I'm trying to use a custom theme but I keep getting the error: { "status": 1, "file": "/home/adam/Projects/test-material/src/unicorn.scss", "line": 1, ...
Read more >Angular 4 + Material 2 SASS compile error "File to import not ...
I solve preceding issue like following. First step: Create customTheme.scss in src directory. @import '.
Read more >Angular 4 + Material 2 SASS compile error “File to import not ...
I solve preceding issue like following. First step: Create customTheme.scss in src directory. ... Important: import statement depends to angular material version ...
Read more >Error: File to import not found or unreadable: default-theme
When building my application the css compiler is throwing the following error: Error: File to import not found or unreadable: default-theme
Read more >javascript - npm WARN ...需要...的对等方,但没有安装。您必须自己 ...
ERROR in /Users/username/Projects/fireplace/node_modules/@angular/material/typings/tooltip/tooltip.d.ts (13,26): Cannot find module '@angular/cdk/platform'.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Having the same issue. It’s a pity that angular-cli does not have fixed versions on dependencies…
according to @merofeev now we have to add
.scss
extension:@import "~@angular/material/_theming.scss";