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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'kind' of undefined for ng add @nguniversal/express-engine #14490

Closed
asvishnyakov opened this issue May 21, 2019 · 1 comment 路 Fixed by #14496
Closed

Cannot read property 'kind' of undefined for ng add @nguniversal/express-engine #14490

asvishnyakov opened this issue May 21, 2019 · 1 comment 路 Fixed by #14496
Assignees
Labels
area: schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Milestone

Comments

@asvishnyakov
Copy link

馃悶 Bug report

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [x] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Exactly: ng add @nguniversal/express-engine --clientProject my-theme

Is this a regression?

Not tested, but looks like this bug was always here.

Description

If you have the following state of NgModule decorator:

@
NgModule

then it's ok for typescript, it's ok for ng build, but ng add @nguniversal/express-engine --clientProject my-theme fails with Cannot read property 'kind' of undefined error.

馃敩 Minimal Reproduction

Just specify NgModule at next line of @ and run ng add @nguniversal/express-engine --clientProject XXX.

馃敟 Exception or Error


An error occured:
Cannot read property 'kind' of undefined
TypeError: Cannot read property 'kind' of undefined
    at Object.findNode (E:\my-theme\node_modules\@schematics\angular\utility\ast-utils.js:125:14)
    at findBrowserModuleImport (E:\my-theme\node_modules\@schematics\angular\universal\index.js:63:43)
    at E:\my-theme\node_modules\@schematics\angular\universal\index.js:140:37
    at MergeMapSubscriber.input.pipe.operators_1.mergeMap.inputTree [as project] (E:\my-theme\node_modules\@angular-devkit\schematics\src\rules\call.js:74:24)
    at MergeMapSubscriber._tryNext (E:\my-theme\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\operators\mergeMap.js:69:27)
    at MergeMapSubscriber._next (E:\my-theme\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\operators\mergeMap.js:59:18)
    at MergeMapSubscriber.Subscriber.next (E:\my-theme\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\Subscriber.js:67:18)
    at MergeMapSubscriber.notifyNext (E:\my-theme\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\operators\mergeMap.js:92:26)
    at InnerSubscriber._next (E:\my-theme\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\InnerSubscriber.js:28:21)
    at InnerSubscriber.Subscriber.next (E:\my-theme\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\Subscriber.js:67:18)
    at E:\my-theme\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\util\subscribeTo.js:17:28
    at Object.subscribeToResult (E:\my-theme\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\util\subscribeToResult.js:10:45)
    at MergeMapSubscriber._innerSub (E:\my-theme\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\operators\mergeMap.js:82:29)
    at MergeMapSubscriber._tryNext (E:\my-theme\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\operators\mergeMap.js:76:14)
    at MergeMapSubscriber._next (E:\my-theme\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\operators\mergeMap.js:59:18)
    at MergeMapSubscriber.Subscriber.next (E:\my-theme\node_modules\@angular-devkit\schematics\node_modules\rxjs\internal\Subscriber.js:67:18)

馃實 Your Environment


Angular CLI: 7.3.9
Node: 10.15.3
OS: win32 x64
Angular: 7.2.15
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.13.9
@angular-devkit/build-angular     0.13.9
@angular-devkit/build-optimizer   0.13.9
@angular-devkit/build-webpack     0.13.9
@angular-devkit/core              7.3.9
@angular-devkit/schematics        7.3.9
@angular/cli                      7.3.9
@ngtools/webpack                  7.3.9
@schematics/angular               7.3.9
@schematics/update                0.13.9
rxjs                              6.5.2
typescript                        3.2.4
webpack                           4.29.0

Anything else relevant?

const decoratorMetadata = getDecoratorMetadata(source, 'NgModule', '@angular/core')[0];

@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 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants