angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

AOT build error Cannot read property 'kind' of undefined

Open samalexander opened this issue 9 years ago • 63 comments

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

Angular CLI: 1.5.0 Node: 8.5.0 OS: darwin x64 Angular: 5.0.1 ... animations, common, compiler, compiler-cli, core, forms ... http, language-service, platform-browser ... platform-browser-dynamic, router

@angular/cdk: 5.0.0-rc0 @angular/cli: 1.5.0 @angular/flex-layout: 2.0.0-beta.10-4905443 @angular/material: 5.0.0-rc0 @angular-devkit/build-optimizer: 0.0.32 @angular-devkit/core: 0.0.20 @angular-devkit/schematics: 0.0.35 @ngtools/json-schema: 1.1.0 @ngtools/webpack: 1.8.0 @schematics/angular: 0.1.2 typescript: 2.4.2 webpack-bundle-analyzer: 2.9.1 webpack: 3.8.1

Repro steps.

rm -rf node_modules/ yarn add @angular/cli@latest -D ng build --aot

The log given by the failure.

ERROR in Error: TypeError: Cannot read property 'kind' of undefined at nodeCanBeDecorated (/Users/sam/Developer/ng-prime/node_modules/typescript/lib/typescript.js:7805:35) at nodeIsDecorated (/Users/sam/Developer/ng-prime/node_modules/typescript/lib/typescript.js:7825:16) at Object.nodeOrChildIsDecorated (/Users/sam/Developer/ng-prime/node_modules/typescript/lib/typescript.js:7829:16) at isDecoratedClassElement (/Users/sam/Developer/ng-prime/node_modules/typescript/lib/typescript.js:51668:23) at isInstanceDecoratedClassElement (/Users/sam/Developer/ng-prime/node_modules/typescript/lib/typescript.js:51659:20) at Object.filter (/Users/sam/Developer/ng-prime/node_modules/typescript/lib/typescript.js:1652:25) at getDecoratedClassElements (/Users/sam/Developer/ng-prime/node_modules/typescript/lib/typescript.js:51641:23) at generateClassElementDecorationExpressions (/Users/sam/Developer/ng-prime/node_modules/typescript/lib/typescript.js:51815:27) at addClassElementDecorationStatements (/Users/sam/Developer/ng-prime/node_modules/typescript/lib/typescript.js:51804:44) at visitClassDeclaration (/Users/sam/Developer/ng-prime/node_modules/typescript/lib/typescript.js:51131:13) at visitTypeScript (/Users/sam/Developer/ng-prime/node_modules/typescript/lib/typescript.js:50972:28) at visitorWorker (/Users/sam/Developer/ng-prime/node_modules/typescript/lib/typescript.js:50785:24) at sourceElementVisitorWorker (/Users/sam/Developer/ng-prime/node_modules/typescript/lib/typescript.js:50817:28) at saveStateAndInvoke (/Users/sam/Developer/ng-prime/node_modules/typescript/lib/typescript.js:50738:27) at sourceElementVisitor (/Users/sam/Developer/ng-prime/node_modules/typescript/lib/typescript.js:50799:20) at visitNodes (/Users/sam/Developer/ng-prime/node_modules/typescript/lib/typescript.js:49280:48)

Desired functionality.

AOT build should be successful

Mention any other details that might be useful.

The project built fine with AOT enabled with CLI v1.4.9

samalexander avatar Nov 10 '17 10:11 samalexander

I believe you missed type of chartist package. Try below: npm install chartist

EssieShey avatar Dec 21 '18 02:12 EssieShey

Same error in @angular/cli 7.3.0 when running 'ng serve --proxy-config proxy.conf.js --port 4500 -o':

"dependencies": {
    "@angular/animations": "7.2.0",
    "@angular/cdk": "^7.2.1",
    "@angular/common": "7.2.0",
    "@angular/compiler": "^7.2.0",
    "@angular/core": "7.2.0",
    "@angular/flex-layout": "^7.0.0-beta.22",
    "@angular/forms": "^7.2.0",
    "@angular/http": "7.2.0",
    "@angular/material": "^7.2.1",
    "@angular/platform-browser": "7.2.0",
    "@angular/platform-browser-dynamic": "7.2.0",
    "@angular/router": "7.2.0",
    "@angular/service-worker": "7.2.0",
    "@auth0/angular-jwt": "^2.0.0",
    "@ngx-formly/core": "^4.8.2",
    "@ngx-formly/material": "^4.8.2",
    "@ngx-translate/core": "^11.0.1",
    "@ngx-translate/http-loader": "^4.0.0",
    "core-js": "^2.6.2",
    "es6-promise": "^4.2.5",
    "hammerjs": "^2.0.8",
    "material-design-icons-iconfont": "^4.0.3",
    "moment": "^2.22.1",
    "ngx-cookie": "^4.1.2",
    "rxjs": "^6.3.3",
    "tslib": "^1.9.0",
    "url": "^0.11.0",
    "util": "^0.11.0",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.13.0",
    "@angular/cli": "^7.3.0",
    "@angular/compiler-cli": "^7.2.0",
    "@angular/language-service": "7.2.0",
    "@angular/platform-server": "^7.2.0",
    "@biesbjerg/ngx-translate-extract": "^2.3.1",
    "@nguniversal/express-engine": "^7.0.2",
    "@ngx-rocket/scripts": "^3.0.1",
    "@types/jasmine": "^3.3.5",
    "@types/jasminewd2": "^2.0.5",
    "@types/lodash": "^4.14.117",
    "@types/node": "^10.12.0",
    "typescript": "^3.2.4"
}
ERROR in : TypeError: Cannot read property 'kind' of undefined
    at getAssignmentTargetKind (...\node_modules\typescript\lib\typescript.js:10228:28)
    at Object.isAssignmentTarget (...\node_modules\typescript\lib\typescript.js:10271:16)
    at checkObjectLiteral (...\node_modules\typescript\lib\typescript.js:47313:45)
    at checkExpressionWorker (...\node_modules\typescript\lib\typescript.js:51812:28)
    at checkExpression (...\node_modules\typescript\lib\typescript.js:51757:42)
    at checkExpressionWithContextualType (...\node_modules\typescript\lib\typescript.js:51587:26)
    at checkApplicableSignature (...\node_modules\typescript\lib\typescript.js:48906:35)
    at chooseOverload (...\node_modules\typescript\lib\typescript.js:49225:26)
    at resolveCall (...\node_modules\typescript\lib\typescript.js:49177:26)
    at resolveCallExpression (...\node_modules\typescript\lib\typescript.js:49484:20)
    at resolveSignature (...\node_modules\typescript\lib\typescript.js:49772:28)
    at getResolvedSignature (...\node_modules\typescript\lib\typescript.js:49804:26)
    at checkCallExpression (...\node_modules\typescript\lib\typescript.js:49896:29)
    at checkExpressionWorker (...\node_modules\typescript\lib\typescript.js:51823:28)
    at checkExpression (...\node_modules\typescript\lib\typescript.js:51757:42)
    at resolveDecorator (...\node_modules\typescript\lib\typescript.js:49691:28)

i 「wdm」: Failed to compile.

It fails on rebuilding the project when changes are detected. Forcing a new rebuild (changing some code) use to build it correctly.

gerardcarbo avatar Feb 06 '19 09:02 gerardcarbo

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.