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

Building libs with dependency: Unable to write a reference #6858

Closed
va-stefanek opened this issue Aug 26, 2021 · 3 comments
Closed

Building libs with dependency: Unable to write a reference #6858

va-stefanek opened this issue Aug 26, 2021 · 3 comments
Labels
outdated scope: angular Issues related to Angular support in Nx type: bug

Comments

@va-stefanek
Copy link

va-stefanek commented Aug 26, 2021

Current Behavior

When building my library with it's dependency which is another library with single component I get this error:
ERROR in Unable to write a reference to ButtonComponent

The compilationMode within tsconfig.lib.prod.json is set to partial. When I changed that end set "enableIvy": false similarly to your example everything works fine.

I see that there is similar close issue on Angular repo angular/angular#29361

Expected Behavior

Build should pass.

Steps to Reproduce

I have a complex project setup, a monorepo with multiple Angular libs.

Environment

nx : Not Found
@nrwl/angular : 12.4.0
@nrwl/cli : 12.4.0
@nrwl/cypress : 12.4.0
@nrwl/devkit : 12.4.0
@nrwl/eslint-plugin-nx : 12.4.0
@nrwl/express : Not Found
@nrwl/jest : 12.4.0
@nrwl/linter : 12.4.0
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/react : 12.0.8
@nrwl/schematics : Not Found
@nrwl/tao : 12.4.0
@nrwl/web : 12.0.8
@nrwl/workspace : 12.4.0
@nrwl/storybook : 12.4.0
@nrwl/gatsby : Not Found
typescript : 4.3.4

@FrozenPandaz FrozenPandaz added the scope: angular Issues related to Angular support in Nx label Aug 26, 2021
@va-stefanek
Copy link
Author

I have figure out that the name of the lib within package.json must be exactly the same as the path declared within tsconfig.base.json e.g @component/ui/button.

@Coly010
Copy link
Contributor

Coly010 commented Aug 27, 2021

Duplicate of: #6648

Closing this ensure one issue being used to track the problem.

@va-stefanek Thanks for raising this! I'm currently working on a migration that will be included in Nx 12.9 (not released yet) that will fix this for anyone affected.

@Coly010 Coly010 closed this as completed Aug 27, 2021
@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: angular Issues related to Angular support in Nx type: bug
Projects
None yet
Development

No branches or pull requests

3 participants