Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@alxhub
Copy link
Member

@alxhub alxhub commented Apr 9, 2021

When an Ivy NgModule is imported into a View Engine build, it doesn't have
metadata.json files that describe it as an NgModule, so it appears to VE
builds as a plain, undecorated class. The error message shown in this
situation generic and confusing, since it recommends adding an @NgModule
annotation to a class from a library.

This commit adds special detection into the View Engine compiler to give a
more specific error message when an Ivy NgModule is imported.

@google-cla google-cla bot added the cla: yes label Apr 9, 2021
@zarend zarend added the area: compiler Issues related to `ngc`, Angular's template compiler label Apr 9, 2021
@ngbot ngbot bot added this to the Backlog milestone Apr 9, 2021
When an Ivy NgModule is imported into a View Engine build, it doesn't have
metadata.json files that describe it as an NgModule, so it appears to VE
builds as a plain, undecorated class. The error message shown in this
situation generic and confusing, since it recommends adding an @NgModule
annotation to a class from a library.

This commit adds special detection into the View Engine compiler to give a
more specific error message when an Ivy NgModule is imported.
@alxhub alxhub force-pushed the ngc/warn-ivy-libs branch from 7c45335 to 87defbb Compare April 12, 2021 16:11
@alxhub alxhub added the target: patch This PR is targeted for the next patch release label Apr 12, 2021
@alxhub alxhub marked this pull request as ready for review April 12, 2021 18:23
@pullapprove pullapprove bot requested a review from AndrewKushnir April 12, 2021 19:35
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

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

Reviewed-for: public-api

@pullapprove pullapprove bot requested a review from atscott April 12, 2021 19:35
Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

Reviewed-for: public-api

@pullapprove pullapprove bot requested a review from jelbourn April 12, 2021 19:54
@mary-poppins
Copy link

You can preview 7c45335 at https://pr41534-7c45335.ngbuilds.io/.
You can preview 87defbb at https://pr41534-87defbb.ngbuilds.io/.

2) the library was published for Angular Ivy and v12+ applications only. Check its peer dependencies carefully and ensure that you're using a compatible version of Angular.
See https://angular.io/errors/NG6999 for more information.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a corresponding PR that adds this page?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not yet - I reached out to devrel about what content we want to add here.

@pullapprove pullapprove bot requested a review from atscott April 12, 2021 21:21
Copy link
Contributor

@jessicajaniuk jessicajaniuk left a comment

Choose a reason for hiding this comment

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

LGTM 🍪

reviewed-for: public-api

@alxhub alxhub added the action: merge The PR is ready for merge by the caretaker label Apr 13, 2021
@zarend zarend closed this in c9aa87c Apr 13, 2021
zarend pushed a commit that referenced this pull request Apr 13, 2021
When an Ivy NgModule is imported into a View Engine build, it doesn't have
metadata.json files that describe it as an NgModule, so it appears to VE
builds as a plain, undecorated class. The error message shown in this
situation generic and confusing, since it recommends adding an @NgModule
annotation to a class from a library.

This commit adds special detection into the View Engine compiler to give a
more specific error message when an Ivy NgModule is imported.

PR Close #41534
alxhub added a commit to alxhub/angular that referenced this pull request Apr 13, 2021
…lar#41534)

When an Ivy NgModule is imported into a View Engine build, it doesn't have
metadata.json files that describe it as an NgModule, so it appears to VE
builds as a plain, undecorated class. The error message shown in this
situation generic and confusing, since it recommends adding an @NgModule
annotation to a class from a library.

This commit adds special detection into the View Engine compiler to give a
more specific error message when an Ivy NgModule is imported.

PR Close angular#41534
zarend pushed a commit that referenced this pull request Apr 14, 2021
…) (#41598)

When an Ivy NgModule is imported into a View Engine build, it doesn't have
metadata.json files that describe it as an NgModule, so it appears to VE
builds as a plain, undecorated class. The error message shown in this
situation generic and confusing, since it recommends adding an @NgModule
annotation to a class from a library.

This commit adds special detection into the View Engine compiler to give a
more specific error message when an Ivy NgModule is imported.

PR Close #41534

PR Close #41598
@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 May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: compiler Issues related to `ngc`, Angular's template compiler cla: yes target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants