fix(compiler-cli): show a more specific error for Ivy NgModules#41534
fix(compiler-cli): show a more specific error for Ivy NgModules#41534alxhub wants to merge 1 commit intoangular:masterfrom
Conversation
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.
7c45335 to
87defbb
Compare
AndrewKushnir
left a comment
There was a problem hiding this comment.
Reviewed-for: public-api
petebacondarwin
left a comment
There was a problem hiding this comment.
Reviewed-for: public-api
|
You can preview 7c45335 at https://pr41534-7c45335.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. |
There was a problem hiding this comment.
Is there a corresponding PR that adds this page?
There was a problem hiding this comment.
Not yet - I reached out to devrel about what content we want to add here.
jessicajaniuk
left a comment
There was a problem hiding this comment.
LGTM 🍪
reviewed-for: public-api
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
…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
…) (#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
|
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. |
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.