Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: "Can't find stylesheet to import" when using Yarn PnP #2654

Open
michaelfaith opened this issue Jul 18, 2023 · 1 comment
Open

bug: "Can't find stylesheet to import" when using Yarn PnP #2654

michaelfaith opened this issue Jul 18, 2023 · 1 comment
Labels

Comments

@michaelfaith
Copy link
Contributor

Type of Issue

[x] Bug Report
[ ] Feature Request

Description

When migrating our library to use Yarn PnP, it's no longer resolving the @angular/material sass api at build time. This resolved fine prior to the pnp shift. @angular/material is declared as a peer dependency of the library (and installed as devDep for testing)

× Compiling with Angular sources in Ivy partial compilation mode.
Can't find stylesheet to import.

6 │ @use '@angular/material' as mat;
  │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

How To Reproduce

In a library project within a repo using yarn pnp, try using the root sass api from @angular/material within a component's stylesheet.

@use '@angular/material' as mat;

When building, it should fail to resolve.

Expected Behaviour

Should build successfully

Version Information

$ node_modules/.bin/ng-packagr --version
ng-packagr: 16.1.0
@angular/*: 16.1.2
typescript: 5.1.6
rxjs: 7.8.1
node: 16.19.0
yarn: 3.6.0
@michaelfaith michaelfaith changed the title bug: Can't find stylesheet to import when using Yarn PnP bug: "Can't find stylesheet to import" when using Yarn PnP Jul 18, 2023
@michaelfaith
Copy link
Contributor Author

michaelfaith commented Jul 18, 2023

Related: loading styles from the angular.json for app builds was addressed here: angular/angular-cli#23971

@alan-agius4 alan-agius4 added the bug label Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants