You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Compilation error in Ivy mode with 8.0.0-rc.5 #30680
Unfortunately, I can't reproduce without a repo. Locally installing angular-star-rating and running ngcc completes successfully. Could you provide a Github repo we may clone?
First of all, I didn't run ngcc, I ran ng build --prod command as I mentioned in the description.
But I noticed that you released 8.0 yesterday so I tried to upgdate my project again:
ng update --force=true --packageManager=yarn @angular/cli @angular/core
Unfortunately if I run ng build --prod or node_modules/.bin/ivy-ngcc I still get this exception.
If I set "enableIvy": false in tsconfig.json then ng build --prod command worked successfully. And if change it to "enableIvy": true then I get error message, but a different one:
ERROR in node_modules/angular-star-rating/src/angular-star-rating.module.d.ts(2,22): error TS-996002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class
I understand that you didn't run ngcc, so that's why the reproduction was required for me to be able to run ng build --prod. The error you experience now does seem to indicate that ngcc did not process angular-star-rating. Could you check for me if you have @angular/forms installed? It is a peer dependency of angular-star-rating and if it's not installed, angular-star-rating is not processed.
It looks like the angular-star-rating package is not properly processed by ngcc, as it uses an old tsickle syntax for the decorator metadata.
Look for StarRatingModule.decorators in its ES5 bundle, you'll find it at the root of the module. With more recent versions of tsickle, that statement is instead emitted within the IIFE. At this moment, ngcc only searches for decorator metadata within the IIFE, not at the root. Hence, no Ivy code is generated for the package, resulting in the error.
@IlCallo This library is not actively maintained (like many others) so I guess the best option here is not to force library creators to migrate to new format but to ask for Anguar team support of these libraries.
Does this make sense for you?
I opened PR #30795 that should get this supported. Unfortunately, we hit a restriction in TypeScript that currently requires an awful hack to workaround, so this might not get in shortly.
I just retested this with 8.1.0-next.3 and the issue has indeed been resolved with #30795. I forgot to link this issue from that PR so it wasn't auto-closed, I'll do that now.
Activity
JoostK commentedon May 27, 2019
Unfortunately, I can't reproduce without a repo. Locally installing
angular-star-ratingand running ngcc completes successfully. Could you provide a Github repo we may clone?sergey-morenets commentedon May 29, 2019
Hi @JoostK
First of all, I didn't run ngcc, I ran ng build --prod command as I mentioned in the description.
But I noticed that you released 8.0 yesterday so I tried to upgdate my project again:
ng update --force=true --packageManager=yarn @angular/cli @angular/core
Unfortunately if I run ng build --prod or node_modules/.bin/ivy-ngcc I still get this exception.
sergey-morenets commentedon May 29, 2019
I will try to create sample repo to reproduce the error but it may take some time
sergey-morenets commentedon May 29, 2019
Hi @JoostK
I created sample repo from clean new Angular 8 project, can you please look at it: https://github.com/sergey-morenets/angular8
If I set "enableIvy": false in tsconfig.json then ng build --prod command worked successfully. And if change it to "enableIvy": true then I get error message, but a different one:
ERROR in node_modules/angular-star-rating/src/angular-star-rating.module.d.ts(2,22): error TS-996002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule classJoostK commentedon May 29, 2019
I understand that you didn't run ngcc, so that's why the reproduction was required for me to be able to run
ng build --prod. The error you experience now does seem to indicate that ngcc did not processangular-star-rating. Could you check for me if you have@angular/formsinstalled? It is a peer dependency ofangular-star-ratingand if it's not installed,angular-star-ratingis not processed.sergey-morenets commentedon May 29, 2019
@JoostK
Yes, it's installed. But actually you can clone my repo and reproduce the issue.
JoostK commentedon May 29, 2019
Thanks 👍 Will have a look later.
JoostK commentedon May 29, 2019
It looks like the
angular-star-ratingpackage is not properly processed by ngcc, as it uses an old tsickle syntax for the decorator metadata.Look for
StarRatingModule.decoratorsin its ES5 bundle, you'll find it at the root of the module. With more recent versions of tsickle, that statement is instead emitted within the IIFE. At this moment, ngcc only searches for decorator metadata within the IIFE, not at the root. Hence, no Ivy code is generated for the package, resulting in the error.sergey-morenets commentedon May 30, 2019
@JoostK
Ok, so you will fix this issue in the next Angular build?
IlCallo commentedon May 30, 2019
Seems more like an update the library maintainer have to fix, than Angular team
JoostK commentedon May 30, 2019
@sergey-morenets We should be able to support this structure. I don't think it will be in the next build though.
sergey-morenets commentedon May 30, 2019
@IlCallo This library is not actively maintained (like many others) so I guess the best option here is not to force library creators to migrate to new format but to ask for Anguar team support of these libraries.
Does this make sense for you?
JoostK commentedon May 31, 2019
I opened PR #30795 that should get this supported. Unfortunately, we hit a restriction in TypeScript that currently requires an awful hack to workaround, so this might not get in shortly.
JoostK commentedon Jun 19, 2019
I just retested this with
8.1.0-next.3and the issue has indeed been resolved with #30795. I forgot to link this issue from that PR so it wasn't auto-closed, I'll do that now.angular-automatic-lock-bot commentedon Sep 15, 2019
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.