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

fix(angular): give informative log when @Component styleUrls names … #15215

Conversation

jonhamm
Copy link
Contributor

@jonhamm jonhamm commented Feb 24, 2023

this will show the path of the file that cannot be located unfortunately I was not able to log the name of the file with the styleUrls that specified the non-existing file

it is still an improvement as prior to this change the only feedback from the build would be this generic message: Cannot read properties of undefined (reading 'includes')

closed #15185

Current Behavior

when some styleUrls property of @Component specifies a path to a non-existing file
then when you run nx build on the library with this component the build fails with this error message:

Cannot read properties of undefined (reading 'includes')

Expected Behavior

the error message of the failing build will be like this:

Cannot read file /Users/xxx/work/git/wt/release/3.20/libs/some-librarysrc/lib/Stylex/some-file.scss.

Related Issue(s)

Fixes #15185

…non-existing file

this will show the path of the file that cannot be located
unfortunately I was not able to log the name of the file with
the `styleUrls` that specified the non-existing file

it is still an improvement as prior to this change
the only feedback from the build would be this generic message:
`Cannot read properties of undefined (reading 'includes')`

closed nrwl#15185
@vercel
Copy link

vercel bot commented Feb 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated
nx-dev ⬜️ Ignored (Inspect) Feb 24, 2023 at 5:46AM (UTC)

@leosvelperez
Copy link
Member

hey @jonhamm! Thanks for the contribution!

Your fix is correct but the ng-packagr executors in Nx are a bit special. We try to keep them in sync as much as possible with the ng-packagr builder in the Angular CLI. This particular issue was already addressed on the builder and we missed it. While your solution is correct, it would deviate from what the builder has which would make harder future updates sync.

For that reason, I'll close this in favor of #15217 which follows the changes applied on the builder.

Once again, thanks for the contribution and keep up helping Nx be better!

@github-actions
Copy link

github-actions bot commented Mar 3, 2023

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ng-packagr-lite shows useless error when invalid styleUrls path
2 participants