-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Ivy compiler doesn't work with secondary entry points in libraries using dist folder #35188
Comments
updated this issue and reproduction from Angular version 9.0.0-rc.14 to version 9.0.0 |
This is a bug in our This leads to ngcc creating the special "ngcc folder" that contains the processed files in the secondary entry-point rather than the primary package folder, which is where the CLI build is configured to look for it. In other words we create angular/packages/compiler-cli/ngcc/src/entry_point_finder/targeted_entry_point_finder.ts Lines 97 to 142 in d3650ce
|
…ed correctly The `TargetedEntryPointFinder` must work out what the containing package is for each entry-point that it finds. The logic for doing this was flawed in the case that the package was in a path-mapped directory and not in a node_modules folder. This meant that secondary entry-points were incorrectly setting their own path as the package path, rather than the primary entry-point path. Fixes angular#35188
Hopefully #35227 will fix this. I am just building and trying out on the reproduction from above. |
I can confirm that, locally, this PR fixes the repro. |
@petebacondarwin Many Thanks, looking forward to the release :-) |
…ed correctly (#35227) The `TargetedEntryPointFinder` must work out what the containing package is for each entry-point that it finds. The logic for doing this was flawed in the case that the package was in a path-mapped directory and not in a node_modules folder. This meant that secondary entry-points were incorrectly setting their own path as the package path, rather than the primary entry-point path. Fixes #35188 PR Close #35227
…ed correctly (angular#35227) The `TargetedEntryPointFinder` must work out what the containing package is for each entry-point that it finds. The logic for doing this was flawed in the case that the package was in a path-mapped directory and not in a node_modules folder. This meant that secondary entry-points were incorrectly setting their own path as the package path, rather than the primary entry-point path. Fixes angular#35188 PR Close angular#35227
…ed correctly (angular#35227) The `TargetedEntryPointFinder` must work out what the containing package is for each entry-point that it finds. The logic for doing this was flawed in the case that the package was in a path-mapped directory and not in a node_modules folder. This meant that secondary entry-points were incorrectly setting their own path as the package path, rather than the primary entry-point path. Fixes angular#35188 PR Close angular#35227
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 bug report
Affected Package
@angular/compiler@9.0.0 (ngcc)
Is this a regression?
Not known
Description
We have a monorepo managed with the Angular CLI with several libraries, each with secondary entry points, and a showcase. We build the libraries using the ViewEngine compiler and the showcase with Ivy. Once we build the showcase, Ivy seems to fail to compile imported symbols in secondary entry points, which results in the error code NG6002 (See error below).
We used the following guide for secondary entry points: https://github.com/ng-packagr/ng-packagr/blob/v9.0.0/docs/secondary-entrypoints.md
The built library artifacts reside in the dist folder (default Angular CLI configuration)
Strangely enough, when we copy the build artifacts into node_modules and remove the
compilerOptions.paths
entry in tsconfig.json, ngcc seems to compile it successfully.If we leave it in dist, ngcc seems to stop compiling secondary entrypoints after the first/entry file.
🔬 Minimal Reproduction
ng build my-lib --prod
ng build showcase --prod
(orng serve
)🔥 Exception or Error
🌍 Your Environment
Angular Version:
Anything else relevant?
Workaround
ng build my-lib --prod
compilerOptions.paths
in tsconfig.jsonng build showcase --prod
(orng serve
)The text was updated successfully, but these errors were encountered: