Install angular-playground using ng add angular-playground --project=sample-project command:
Run angular playground using npm run playground command
Observed Behavior
<!-- [ng serve]:
./src/styles.scss - Error: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Can't find stylesheet to import.
╷
2 │ @import '~sass/zindex';
│ ^^^^^^^^^^^^^^
╵
src/sass/shared.scss 2:9 @import
src/styles.scss 6:9 root stylesheet
at processResult (/Users/user/git/sample-project/node_modules/webpack/lib/NormalModule.js:713:19)
at /Users/user/git/sample-project/node_modules/webpack/lib/NormalModule.js:819:5
at /Users/user/git/sample-project/node_modules/loader-runner/lib/LoaderRunner.js:399:11
at /Users/user/git/sample-project/node_modules/loader-runner/lib/LoaderRunner.js:251:18
at context.callback (/Users/user/git/sample-project/node_modules/loader-runner/lib/LoaderRunner.js:124:13)
at Object.callback (/Users/user/git/sample-project/node_modules/sass-loader/dist/index.js:54:7)
at Worker.<anonymous> (/Users/user/git/sample-project/node_modules/@angular-devkit/build-angular/src/sass/sass-service.js:134:25)
at Worker.emit (events.js:315:20)
at MessagePort.<anonymous> (internal/worker.js:207:53)
at MessagePort.[nodejs.internal.kHybridDispatch] (internal/event_target.js:354:41)
[ng serve]:
** Angular Live Development Server is listening on 127.0.0.1:4201, open your browser on http://127.0.0.1:4201/ **
-->
Desired Behavior
<!--
The app compiles without errors and loads the sass files properly
-->
I've fixed my import issues by adding my configuration to 'playground' to angular.json.
"stylePreprocessorOptions": { "includePaths": ["[your_project_path]/src/styles"] },
Versions
Repro steps
Observed Behavior
Desired Behavior