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

sporadic recompilation ends with ERROR in : TypeError: Cannot read property 'kind' of undefined #13861

Closed
gozzoo opened this issue Mar 9, 2019 · 13 comments
Labels
area: @ngtools/webpack freq1: low Only reported by a handful of users who observe it rarely severity5: regression
Milestone

Comments

@gozzoo
Copy link

gozzoo commented Mar 9, 2019

Versions

Angular CLI: 7.3.4
Node: 10.14.2
OS: win32 ia32
Angular: 7.2.7
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.13.1
@angular-devkit/build-angular     0.13.1
@angular-devkit/build-optimizer   0.13.1
@angular-devkit/build-webpack     0.13.1
@angular-devkit/core              7.3.1
@angular-devkit/schematics        7.3.4
@angular/cli                      7.3.4
@ngtools/webpack                  7.3.1
@schematics/angular               7.3.4
@schematics/update                0.13.4
rxjs                              6.4.0
typescript                        3.2.4
webpack                           4.29.0

Description

When running ng serve sometimes without explicit change in the code the project gets recompiled multiple times in a row. Sometimes this series end with an error:

ERROR in : TypeError: Cannot read property 'kind' of undefined
    at getAssignmentTargetKind (C:\work\tansys\node_modules\typescript\lib\typescript.js:10228:28)
    at Object.isAssignmentTarget (C:\work\tansys\node_modules\typescript\lib\typescript.js:10271:16)
    at checkObjectLiteral (C:\work\tansys\node_modules\typescript\lib\typescript.js:47313:45)
    at checkExpressionWorker (C:\work\tansys\node_modules\typescript\lib\typescript.js:51812:28)
    at checkExpression (C:\work\tansys\node_modules\typescript\lib\typescript.js:51757:42)
    at checkExpressionWithContextualType (C:\work\tansys\node_modules\typescript\lib\typescript.js:51587:26)
    at checkApplicableSignature (C:\work\tansys\node_modules\typescript\lib\typescript.js:48906:35)
    at chooseOverload (C:\work\tansys\node_modules\typescript\lib\typescript.js:49225:26)
    at resolveCall (C:\work\tansys\node_modules\typescript\lib\typescript.js:49177:26)
    at resolveCallExpression (C:\work\tansys\node_modules\typescript\lib\typescript.js:49484:20)
    at resolveSignature (C:\work\tansys\node_modules\typescript\lib\typescript.js:49772:28)
    at getResolvedSignature (C:\work\tansys\node_modules\typescript\lib\typescript.js:49804:26)
    at checkCallExpression (C:\work\tansys\node_modules\typescript\lib\typescript.js:49896:29)
    at checkExpressionWorker (C:\work\tansys\node_modules\typescript\lib\typescript.js:51823:28)
    at checkExpression (C:\work\tansys\node_modules\typescript\lib\typescript.js:51757:42)
    at resolveDecorator (C:\work\tansys\node_modules\typescript\lib\typescript.js:49691:28)
    at resolveSignature (C:\work\tansys\node_modules\typescript\lib\typescript.js:49778:28)
    at getResolvedSignature (C:\work\tansys\node_modules\typescript\lib\typescript.js:49804:26)
    at checkDecorator (C:\work\tansys\node_modules\typescript\lib\typescript.js:53129:29)
    at Object.forEach (C:\work\tansys\node_modules\typescript\lib\typescript.js:210:30)
    at checkDecorators (C:\work\tansys\node_modules\typescript\lib\typescript.js:53311:16)
    at checkClassLikeDeclaration (C:\work\tansys\node_modules\typescript\lib\typescript.js:54988:13)
    at checkClassDeclaration (C:\work\tansys\node_modules\typescript\lib\typescript.js:54982:13)
    at checkSourceElement (C:\work\tansys\node_modules\typescript\lib\typescript.js:56153:28)
    at Object.forEach (C:\work\tansys\node_modules\typescript\lib\typescript.js:210:30)
    at checkSourceFileWorker (C:\work\tansys\node_modules\typescript\lib\typescript.js:56317:20)
    at checkSourceFile (C:\work\tansys\node_modules\typescript\lib\typescript.js:56289:13)
    at Object.forEach (C:\work\tansys\node_modules\typescript\lib\typescript.js:210:30)

The process stops watching for new changes and no further reompilation is hapening. After I stop it and start it again the compilation completes with no errors and it keeps watching for changes, which trigger healthy recompilation.

@alan-agius4
Copy link
Collaborator

Hi, thanks for reporting this.

This seems to be related to microsoft/TypeScript#29365

@alan-agius4
Copy link
Collaborator

This should be solved in the next release (7.3.8)

The commit that addressed this should be fad7ba9

If the problem persist after upgrading kindly open a new issue.

Thanks

@gozzoo
Copy link
Author

gozzoo commented Apr 3, 2019

OK, thanks!

@gozzoo
Copy link
Author

gozzoo commented Apr 8, 2019

I keep having the same/similar problem with 7.3.8:

Angular CLI: 7.3.8
Node: 10.14.2
OS: win32 ia32
Angular: 7.2.12
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.13.1
@angular-devkit/build-angular     0.13.1
@angular-devkit/build-optimizer   0.13.1
@angular-devkit/build-webpack     0.13.1
@angular-devkit/core              7.3.1
@angular-devkit/schematics        7.3.8
@angular/cli                      7.3.8
@ngtools/webpack                  7.3.1
@schematics/angular               7.3.8
@schematics/update                0.13.8
rxjs                              6.4.0
typescript                        3.2.4
webpack                           4.29.0

Here is the error:

ERROR in : TypeError: Cannot read property 'kind' of undefined
at getDiagnosticHeadMessageForDecoratorResolution (C:\work\tansys\node_modules\typescript\lib\typescript.js:49671:33)
at resolveDecorator (C:\work\tansys\node_modules\typescript\lib\typescript.js:49706:31)
at resolveSignature (C:\work\tansys\node_modules\typescript\lib\typescript.js:49778:28)
at getResolvedSignature (C:\work\tansys\node_modules\typescript\lib\typescript.js:49804:26)
at checkDecorator (C:\work\tansys\node_modules\typescript\lib\typescript.js:53129:29)
at Object.forEach (C:\work\tansys\node_modules\typescript\lib\typescript.js:210:30)
at checkDecorators (C:\work\tansys\node_modules\typescript\lib\typescript.js:53311:16)
at checkClassLikeDeclaration (C:\work\tansys\node_modules\typescript\lib\typescript.js:54988:13)
at checkClassDeclaration (C:\work\tansys\node_modules\typescript\lib\typescript.js:54982:13)
at checkSourceElement (C:\work\tansys\node_modules\typescript\lib\typescript.js:56153:28)
at Object.forEach (C:\work\tansys\node_modules\typescript\lib\typescript.js:210:30)
at checkSourceFileWorker (C:\work\tansys\node_modules\typescript\lib\typescript.js:56317:20)
at checkSourceFile (C:\work\tansys\node_modules\typescript\lib\typescript.js:56289:13)
at Object.forEach (C:\work\tansys\node_modules\typescript\lib\typescript.js:210:30)
at getDiagnosticsWorker (C:\work\tansys\node_modules\typescript\lib\typescript.js:56382:16)
at getDiagnostics (C:\work\tansys\node_modules\typescript\lib\typescript.js:56350:24)
at Object.getEmitResolver (C:\work\tansys\node_modules\typescript\lib\typescript.js:31393:13)
at emitWorker (C:\work\tansys\node_modules\typescript\lib\typescript.js:86924:69)
at C:\work\tansys\node_modules\typescript\lib\typescript.js:86887:66
at runWithCancellationToken (C:\work\tansys\node_modules\typescript\lib\typescript.js:86979:24)
at Object.emit (C:\work\tansys\node_modules\typescript\lib\typescript.js:86887:20)
at AngularCompilerPlugin._emit (C:\work\tansys\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:834:48)
at AngularCompilerPlugin._update (C:\work\tansys\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:676:50)
at process._tickCallback (internal/process/next_tick.js:68:7)

@joehansen
Copy link

joehansen commented Apr 8, 2019

For me it works again updating to:

Angular 7.2.12
CLI: 7.3.8 + global version
devkit: 0.13.8

And delete node_modules and new npm i

@gozzoo
Copy link
Author

gozzoo commented Apr 9, 2019

I just did full reinstall and the problem persists.

  1. I deleted node_modules folder
  2. I deleted node_cache folder
  3. I did: npm install in the project folder

What's interesting is that the re-compilation is caused by seemingly unrelated events like resizing termial window in VSCode or starting production build in another terminal ng build --prod. Recompilation is oftern triggered by loading the app in the browser. It also happened after I did file search in VSCode.

Not each sporadic recompilation ends with error, but sometimes it does.

@acohenOT
Copy link
Contributor

acohenOT commented Apr 9, 2019

I no longer see the 'kind' error after updating but I notice that the spontaneous re-compilation still occurs -- though it results in a successful compilation. Something is still not right.

@alan-agius4
Copy link
Collaborator

@gozzoo, you also need to update the devkit packages.

@gozzoo
Copy link
Author

gozzoo commented Apr 10, 2019

@alan-agius4 how shoud I do that?

When I run ng update it doesn't show any obsolete packates.

When I try to update devkit anyways with ng update @angular-devkit/core I get this:

    Package not installed: "@angular-devkit/core". Skipping.
    We analyzed your package.json and everything seems to be in order. Good work!

Isn't ng update supposed to take care of this or I should update each devkit package individually with npm?

@gozzoo
Copy link
Author

gozzoo commented Apr 11, 2019

I just did ng update @angular-devkit/build-angular and it updated all devkit packages. Noww everything is up to date.

It wasn't very obvious thogh and ng update didn't mention anything about any of the devkit packages.

@gozzoo
Copy link
Author

gozzoo commented Apr 12, 2019

I see that the devkit update issue has been reported in #13581, which is closed now. Let's hope that it will be released in the next angular-cli patch version.

I'm submitting new issue #14146 for the spontaneous re-compilation.

@ghanashyam-c-k
Copy link

I am also getting this error frequently. Even by doing a folder search in vscode, recompilation fires.
I am using Angular CLI v7.3.8 and Node v10.15.3

@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: @ngtools/webpack freq1: low Only reported by a handful of users who observe it rarely severity5: regression
Projects
None yet
Development

No branches or pull requests

5 participants