DEV Community

Mandal, Chandan
Mandal, Chandan

Posted on • Edited on

Angular 17 issue : Can't find stylesheet to import

Getting below error after upgrading Angular version from 16 to 17. Please suggest to resolve the issue. let me know if you need further info.

./src/styles.scss - Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
Can't find stylesheet to import.

1 │ @use '@angular/material/theming';
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src\abc-angular-material.theme.scss 1:1 @use
src\styles.scss 2:1 root stylesheet

./src/styles.scss?ngGlobalStyle - Error: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
HookWebpackError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
Can't find stylesheet to import.

1 │ @import '@angular/material/theming';
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^

src\abc-angular-material.theme.scss 1:9 @import
src\styles.scss 2:9 root stylesheet

Top comments (1)

Collapse
 
mandac2_mdt profile image
Mandal, Chandan

Im able to resolve the above "Can't find stylesheet to import." error after modifying the custom scss file based on Angular 17 version packages update for angular/material.

Now application get build successful, but UI is not loading. Can you please help on this issue.