Skip to content

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

Merged
vikerman merged 1 commit into
angular:masterfrom
petebacondarwin:ngcc-integration-fix
Jun 28, 2019
Merged

vikerman merged 1 commit into
angular:masterfrom
petebacondarwin:ngcc-integration-fix

Conversation

@petebacondarwin

Copy link
Copy Markdown
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)

@alan-agius4 alan-agius4 left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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
Copy Markdown

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