You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used NX team's solution to create angular libraries @nrwl/angular:package
All libraries from the repository are published after each release, but are used mainly for building applications within the repository.
The problem became known when 1 of the libraries was installed in another repository.
It turns out that the generic type resolution creates a dynamic import that leads to objects inside the repository through Explorer, rather than leaving package references as expected. Because of this, any build outside the repository is impossible, since there is no dist directory that is specified in the library build.
I've created a test repository that can recreate this issue (link).
It also turned out that the native builder from the angular team @angular-devkit/build-angular:ng-packagr with the paths specified in tsconfig eliminates this problem and the paths in the build remain correct.
Expected Behavior
When building via @nrwl/angular:package, the paths between packages are not resolved through the explorer, but remain according to the import, as in the source files
nx build shared - will create the wrong case in the dist directory
nx native-build shared - will create the correct case in the dist directory
Nx Report
Node : 16.20.0
OS : darwin arm64
npm : 8.19.4
nx : 14.8.8
@nrwl/angular : 14.8.8
@nrwl/cypress : 14.8.8
@nrwl/detox : Not Found
@nrwl/devkit : 14.8.8
@nrwl/esbuild : Not Found
@nrwl/eslint-plugin-nx : 14.8.8
@nrwl/expo : Not Found
@nrwl/express : Not Found
@nrwl/jest : 14.8.8
@nrwl/js : 14.8.8
@nrwl/linter : 14.8.8
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/nx-cloud : Not Found
@nrwl/nx-plugin : Not Found
@nrwl/react : Not Found
@nrwl/react-native : Not Found
@nrwl/rollup : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : 14.8.8
@nrwl/web : Not Found
@nrwl/webpack : 14.8.8
@nrwl/workspace : 14.8.8
typescript : 4.7.4
---------------------------------------
Local workspace plugins:
---------------------------------------
Community plugins:
Failure Logs
-
Package Manager Version
No response
Operating System
macOS
Linux
Windows
Other (Please specify)
Additional Information
No response
The text was updated successfully, but these errors were encountered:
This is an issue that has already been solved. Please update your Nx version to at least 15.1.1 (last version with Angular 14 if you need to stay on that Angular version) and the issue should be solved:
nx migrate 15.1.1
nx migrate --run-migrations
I tested the above in the provided repo, and the issue went away. I'm closing this since it has already been solved.
Current Behavior
I used NX team's solution to create angular libraries
@nrwl/angular:package
All libraries from the repository are published after each release, but are used mainly for building applications within the repository.
The problem became known when 1 of the libraries was installed in another repository.
It turns out that the generic type resolution creates a dynamic import that leads to objects inside the repository through Explorer, rather than leaving package references as expected. Because of this, any build outside the repository is impossible, since there is no dist directory that is specified in the library build.
I've created a test repository that can recreate this issue (link).
It also turned out that the native builder from the angular team
@angular-devkit/build-angular:ng-packagr
with the paths specified in tsconfig eliminates this problem and the paths in the build remain correct.Expected Behavior
When building via
@nrwl/angular:package
, the paths between packages are not resolved through the explorer, but remain according to the import, as in the source filesGitHub Repo
https://github.com/Misterion96/nx-imports/tree/main
Steps to Reproduce
Nx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: