DEV Community

Mandal, Chandan
Mandal, Chandan

Posted on • Edited on

3

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

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

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.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more