Angular-cli: .30 AOT fails with Module build failed: TypeError: Cannot read property 'kind' of undefined

Created on 4 Feb 2017  路  3Comments  路  Source: angular/angular-cli

OS

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

@angular/cli: 1.0.0-beta.30
node: 6.9.5
os: win32 x64
@angular/cli: 1.0.0-beta.30
@angular/common: 2.4.6
@angular/compiler: 2.4.6
@angular/core: 2.4.6
@angular/forms: 2.4.6
@angular/http: 2.4.6
@angular/language-service: 2.4.6
@angular/platform-browser: 2.4.6
@angular/platform-browser-dynamic: 2.4.6
@angular/router: 3.4.5
@angular/compiler-cli: 2.4.6
@ngtools/webpack: 1.2.8

Repro steps.

With latest .30 getting errors with AOT mode:

ERROR in ./src/store/effects/appdb.effects.ts
Module build failed: TypeError: Cannot read property 'kind' of undefined
    at C:\Temp\ia\studioweb\node_modules\@ngtools\webpack\src\loader.js:93:31
    at Array.map (native)
    at _addCtorParameters (C:\Temp\ia\studioweb\node_modules\@ngtools\webpack\src\loader.js:92:46)
    at C:\Temp\ia\studioweb\node_modules\@ngtools\webpack\src\loader.js:114:17
    at Array.forEach (native)
    at _removeDecorators (C:\Temp\ia\studioweb\node_modules\@ngtools\webpack\src\loader.js:109:10)
    at C:\Temp\ia\studioweb\node_modules\@ngtools\webpack\src\loader.js:282:48
    at process._tickCallback (internal/process/next_tick.js:103:7)
 @ ./src/locale/app/app-module.ngfactory.ts 65:0-62
 @ ./src/main.ts
 @ multi ./src/main.ts

ERROR in ./src/store/effects/msdb.effects.ts
Module build failed: TypeError: Cannot read property 'kind' of undefined
    at C:\Temp\ia\studioweb\node_modules\@ngtools\webpack\src\loader.js:93:31
    at Array.map (native)
    at _addCtorParameters (C:\Temp\ia\studioweb\node_modules\@ngtools\webpack\src\loader.js:92:46)
    at C:\Temp\ia\studioweb\node_modules\@ngtools\webpack\src\loader.js:114:17
    at Array.forEach (native)
    at _removeDecorators (C:\Temp\ia\studioweb\node_modules\@ngtools\webpack\src\loader.js:109:10)
    at C:\Temp\ia\studioweb\node_modules\@ngtools\webpack\src\loader.js:282:48
    at process._tickCallback (internal/process/next_tick.js:103:7)
 @ ./src/locale/app/app-module.ngfactory.ts 66:0-61
 @ ./src/main.ts
 @ multi ./src/main.ts

ERROR in ./src/comps/sliderpanel/Sliderpanel.ts
Module build failed: TypeError: Cannot read property 'kind' of undefined
    at C:\Temp\ia\studioweb\node_modules\@ngtools\webpack\src\loader.js:93:31
    at Array.map (native)
    at _addCtorParameters (C:\Temp\ia\studioweb\node_modules\@ngtools\webpack\src\loader.js:92:46)
    at C:\Temp\ia\studioweb\node_modules\@ngtools\webpack\src\loader.js:114:17
    at Array.forEach (native)
    at _removeDecorators (C:\Temp\ia\studioweb\node_modules\@ngtools\webpack\src\loader.js:109:10)
    at C:\Temp\ia\studioweb\node_modules\@ngtools\webpack\src\loader.js:282:48
    at process._tickCallback (internal/process/next_tick.js:103:7)
 @ ./src/modules/shared.module.ts 2:0-63
 @ ./src/locale/app/app-module.ngfactory.ts
 @ ./src/main.ts
 @ multi ./src/main.ts

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "x_prod_aot"
npm ERR! node v6.9.5
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] x_prod_aot: `ng build --target=production --base-href ./ --aot true`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] x_prod_aot script 'ng build --target=production --base-href ./ --aot true'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the studioweb package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ng build --target=production --base-href ./ --aot true
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs studioweb
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls studioweb
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Temp\ia\studioweb\npm-debug.log

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "release_aot"
npm ERR! node v6.9.5
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] release_aot: `rm -r -f ./dist && npm run x_bump && npm run x_prod_aot && npm run x_sw && npm run x_rsync`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] release_aot script 'rm -r -f ./dist && npm run x_bump && npm run x_prod_aot && npm run x_sw && npm run x_rsync'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the studioweb package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     rm -r -f ./dist && npm run x_bump && npm run x_prod_aot && npm run x_sw && npm run x_rsync
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs studioweb
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls studioweb
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Temp\ia\studioweb\npm-debug.log

root@DESKTOP-VEUHFOL /cygdrive/c/Temp/ia/studioweb
$


JIT works with both re-builds and lazy loading chunks.
but AOT is no go

anything I can try?

repo:
git clone https://github.com/born2net/studioweb.git

regards

Sean

Most helpful comment

I think this is reported already in another issue. In that issue it was about @inject in a constructor parameter. I suggested that adding a type to the parameter, any type, even any, would fix it, and the issue creator confirmed this worked.

Try this as a workaround. Just stick : any in front of it.

All 3 comments

so I can confirm removing every single @inject "fixes" the issues as a workaround
hope we can get it fixed as I still need to @inject
for example

 @Inject(DOCUMENT) private doc

regards

I think this is reported already in another issue. In that issue it was about @inject in a constructor parameter. I suggested that adding a type to the parameter, any type, even any, would fix it, and the issue creator confirmed this worked.

Try this as a workaround. Just stick : any in front of it.

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._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gotschmarcel picture gotschmarcel  路  3Comments

jmurphzyo picture jmurphzyo  路  3Comments

5amfung picture 5amfung  路  3Comments

sysmat picture sysmat  路  3Comments

rwillmer picture rwillmer  路  3Comments