Skip to content

fix(@ngtools/webpack): NGCC should process secondary entry-points #14934

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

Merged
merged 1 commit into from
Jun 28, 2019

Conversation

petebacondarwin
Copy link
Contributor

Previously secondary entry-points, e.g
@angular/common/http, were being resolved to
the primary entry-point, e.g @angular/common.
This meant that these entry-points were not being
processed as part of a compilation leading to error messages.

This change inverts the tryResolvePackage logic
to attempt to use require.resolve() first and only
looking in the parent directory of the typings file
as a fallback if the main resolve fails.

Fixes angular/angular#30972 (comment)

Previously secondary entry-points, e.g
`@angular/common/http`,  were being resolved to
the primary entry-point, e.g `@angular/common`.
This meant that these entry-points were not being
processed as part of a compilation leading to error messages.

This change inverts the `tryResolvePackage` logic
to attempt to use `require.resolve()` first and only
looking in the parent directory of the typings file
as a fallback if the main resolve fails.

Fixes angular/angular#30972 (comment)
Copy link
Collaborator

@alan-agius4 alan-agius4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks mate!

@alan-agius4 alan-agius4 added target: major This PR is targeted for the next major release and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jun 28, 2019
@vikerman vikerman merged commit 6a99e74 into angular:master Jun 28, 2019
@AhsanAyaz
Copy link
Contributor

Awesome @petebacondarwin. I was upgrading my library to use Angular CLI and stumbled upon the same issue with IVY.
Thanks much! 🎉

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @ngtools/webpack effort1: easy (hours) freq2: medium P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity2: inconvenient target: major This PR is targeted for the next major release type: bug/fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ivy preview report: error TS-996002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class
5 participants