Description
Please provide us with the following information:
I had this error when I upgraded to beta 28.3 and found a way to build with AOT.
Here's the error and how to temporarily avoid breaking your AOT build until this get fixed.
OS?
Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Ubuntu 16.10 x64
Versions.
Please run
ng --version
. If there's nothing outputted, please run in a Terminal:node --version
and paste the result here:
angular-cli: 1.0.0-beta.28.3
node: 7.4.0
os: linux x64
@angular/common: 2.4.5
@angular/compiler: 2.4.5
@angular/core: 2.4.5
@angular/flex-layout: 2.0.0-beta.4
@angular/forms: 2.4.5
@angular/http: 2.4.5
@angular/material: 2.0.0-beta.1
@angular/platform-browser: 2.4.5
@angular/platform-browser-dynamic: 2.4.5
@angular/router: 3.4.5
@angular/compiler-cli: 2.4.5
Repro steps.
Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
Upgrade from angular-cli BETA 26 to 28.3
The log given by the failure.
Normally this include a stack trace and some more information.
ERROR in ./src/app/app.component.ts
Module build failed: TypeError: Cannot read property 'kind' of undefined
at /home/maxime/Documents/petals-cockpit/frontend/node_modules/@ngtools/webpack/src/loader.js:93:31
at Array.map (native)
at _addCtorParameters (/home/maxime/Documents/petals-cockpit/frontend/node_modules/@ngtools/webpack/src/loader.js:92:46)
at /home/maxime/Documents/petals-cockpit/frontend/node_modules/@ngtools/webpack/src/loader.js:114:17
at Array.forEach (native)
at _removeDecorators (/home/maxime/Documents/petals-cockpit/frontend/node_modules/@ngtools/webpack/src/loader.js:109:10)
at /home/maxime/Documents/petals-cockpit/frontend/node_modules/@ngtools/webpack/src/loader.js:280:48
at process._tickCallback (internal/process/next_tick.js:103:7)
@ ./src/$$_gendir/app/app.component.ngfactory.ts 12:0-51
@ ./src/$$_gendir/app/app.module.ngfactory.ts
@ ./src/main.ts
@ multi ./src/main.ts
Mention any other details that might be useful.
When I first upgraded to beta 28.3, my AOT build was broken.
I remembered having issues with yarn
blocking the update of deps with ^
and I thought I would just yarn upgrade
every time I update the cli.
But this time it was the opposite.
TEMP FIX
In order to fix that, once I had run ng init
I had to remove the current yarn.lock
and restore the latest one before the update of angular-cli.
Then run yarn
and it's now working again.
There must have some sub deps breaking the AOT build and using yarn to avoid the update of those deps is helpful here 👍