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
After running ngcc via node_modules/.bin/ivy-ngcc certain Angular decorators are being retained, this is break production builds with Build Optimzer angular/angular-cli#13261.
🔬 Minimal Reproduction
Run ngcc against a node_modules/@angular directory
Open node_modules/@angular/platform-browser/esm5/src/browser.js
Quick update: an initial investigation seems to indicate that the ESM5 browser.js is not being processed at all. Or at least the NgModule aspect of this file is not being processed, which is why the decorator is not being removed.
Other files containing NgModule decorators are being processed.
@alan-agius4 Can you cherry-pick f13fb367e03983fd2e11f7cf344162b1c78c5962 from #26947 and see if that resolves the issue? We are aware of inconsistent behavior in the ESM5 reflection host which should have been accounted for in that commit, possibly resolving this issue (?)
The intermediate assignment apparently fails to be recognized in ngcc's relfection host for ESM5, causing the decorators not to be linked with the class declaration.
Activity
petebacondarwin commentedon Dec 27, 2018
Quick update: an initial investigation seems to indicate that the ESM5 browser.js is not being processed at all. Or at least the NgModule aspect of this file is not being processed, which is why the decorator is not being removed.
Other files containing NgModule decorators are being processed.
alan-agius4 commentedon Dec 27, 2018
There seems to be other files which are not being processed, for example
node_modules/@angular/common/esm5/src/pipes/date_pipe.js
JoostK commentedon Dec 27, 2018
@alan-agius4 Can you cherry-pick f13fb367e03983fd2e11f7cf344162b1c78c5962 from #26947 and see if that resolves the issue? We are aware of inconsistent behavior in the ESM5 reflection host which should have been accounted for in that commit, possibly resolving this issue (?)
alan-agius4 commentedon Dec 27, 2018
@JoostK, thanks for your tip, though that commit doesn't have any effect on this issue.
As @petebacondarwin mentioned it looks that certain files are not being processed at all.
Note: that there are no
.bakfiles for certain files.[-]ngcc retains angular specific decorators[/-][+]ngcc not running on all files (ESM5)[/+]JoostK commentedon Dec 27, 2018
@alan-agius4 ah, pity. It is related to that though, as the source that fails to be recognized is as follows:
The intermediate assignment apparently fails to be recognized in ngcc's relfection host for ESM5, causing the decorators not to be linked with the class declaration.
petebacondarwin commentedon Dec 27, 2018
I believe the error is in this method:
Not that if the statement is an assignment then we take the right hand of the assignment. This works in the case of
giving us the call to
__decorate()but it does not work when there is a chain of assignnments:fix(ivy): ngcc - identify all ESM5 decorated classes
angular-automatic-lock-bot commentedon Sep 14, 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.