Repository navigation
Description
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
13
Description
when enabling preserveSymlinks in angular.json custom stylesheets no longer compile because they cannot find @material/button/button
Reproduction
Steps to reproduce:
- Run
ng new MyProject - Select the default options
- Run
cd MyProject ng add @angular/material- Select the default options, except for the theme, select Custom
- Set
preserveSymlinksto true in angular.json - Run
ng build
Expected Behavior
For the project to build without error
Actual Behavior
The build fails with the following message:
./src/styles.scss - Error: Module build failed (from ./node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/sass-loader/dist/cjs.js):
SassError: Can't find stylesheet to import.
╷
2 │ @use '@material/button/button' as mdc-button;
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╵
node_modules/@angular/material/button/_button-theme.scss 2:1 @use
node_modules/@angular/material/core/density/private/_all-density.scss 2:1 @forward
@angular/_index.scss 18:1 @use
src/styles.scss 1:1 root stylesheet
Environment
Angular CLI: 15.1.4
Node: 18.13.0
Package Manager: pnpm 7.26.2
OS: linux x64
Angular: 15.1.3
... animations, cdk, common, compiler, compiler-cli, core, forms
... material, material-date-fns-adapter, platform-browser
... platform-browser-dynamic, router
Package Version
@angular-devkit/architect 0.1501.4 (cli-only)
@angular-devkit/build-angular 15.1.4
@angular-devkit/core 15.1.4 (cli-only)
@angular-devkit/schematics 15.1.4 (cli-only)
@angular/cli 15.1.4
@schematics/angular 15.1.4 (cli-only)
rxjs 7.5.6
typescript 4.9.5
Activity
mto-siemensgamesa commentedon Feb 21, 2023
I'm keeping an eye on this issue as I have the same issue, except I don't even have
preserveSymlinkset in my project. :) Would love to see what the cause could be.sramocki commentedon Apr 11, 2023
I'm seeing the same issue without
preserveSymlinkbeing set as well. Setting it to false doesn't fix the issue either.crisbeto commentedon May 3, 2023
This is likely an issue in the CLI. Moving to the appropriate repo.
alan-agius4 commentedon Feb 15, 2024
Thanks for reporting this issue. This issue is now obsolete due to changes in the recent releases. Please update to the most recent Angular CLI version.
If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.
bruno-fonts commentedon Feb 15, 2024
Hi @alan-agius4, thanks for the update on this matter and for fixing this. Would you mind pointing us to the CLI version that should have resolved this? Would this be this latest
17.2.0or already fixed somewhere in v16? Thanks 🙏angular-automatic-lock-bot commentedon Mar 17, 2024
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.