Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.30 AOT fails with Module build failed: TypeError: Cannot read property 'kind' of undefined #4427

Closed
born2net opened this issue Feb 4, 2017 · 3 comments · Fixed by #4428
Closed

Comments

@born2net
Copy link

born2net commented Feb 4, 2017

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! studioweb@0.1.93 x_prod_aot: `ng build --target=production --base-href ./ --aot true`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the studioweb@0.1.93 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! studioweb@0.1.92 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 studioweb@0.1.92 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

@born2net born2net changed the title .30 AOT fails with .30 AOT fails with Module build failed: TypeError: Cannot read property 'kind' of undefined Feb 4, 2017
@born2net
Copy link
Author

born2net commented Feb 4, 2017

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

@Meligy
Copy link
Contributor

Meligy commented Feb 4, 2017

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.

hansl added a commit to hansl/angular-cli that referenced this issue Feb 4, 2017
We missed a few cases that were generating errors. Sorry.

Fixes angular#4427
hansl added a commit to hansl/angular-cli that referenced this issue Feb 4, 2017
We missed a few cases that were generating errors. Sorry.

Fixes angular#4427
hansl added a commit that referenced this issue Feb 7, 2017
We missed a few cases that were generating errors. Sorry.

Fixes #4427
MRHarrison pushed a commit to MRHarrison/angular-cli that referenced this issue Feb 9, 2017
We missed a few cases that were generating errors. Sorry.

Fixes angular#4427
asnowwolf pushed a commit to asnowwolf/angular-cli that referenced this issue Apr 12, 2017
We missed a few cases that were generating errors. Sorry.

Fixes angular#4427
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants