-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
TypeError: Cannot read property 'kind' of undefined at getAssignmentTargetKind #29365
Comments
Same issue for me. I use angular 7.2.2, typescript 3.2.4 |
i have the same issue with 7.2.2 and 3.2.4 and with 3.1.6 . |
Same issue with angular 7.2.0, typescript 3.1.6 |
Same issue for me as well, happens during watch mode when a linked library is rebuild. Angular: 7.2.4 Typescript: 3.2.4 |
Any idea ? How can we help you ? |
Same issue with angular 7.2.6 and typescript 3.1.6 |
Don't know if is the same cause, but I'm having the same error with the following code that, although is weird, tsc is not emitting any diagnostics and it crash without stacktrace (was able to get a stacktrace with ts-node).
My two cents, keep it up |
same issue angular 7.2.7, ts 3.2.4 |
@volser when does it happen? Could you make a repro or describe your setup in detail? |
when I first time run |
and only on Windows |
looks like it happens, when I'm making changes during compiling |
I tried to reinstall NodeJs, visual studio code (why not). I tried ng serve on Windows cmd and Powershell. |
As recommended here , Still I'm interested in what's causing it |
@therawk Hi, I installed '@type/history' and it dosn't works. |
@Provson Hmmm I just checked what the package does and as you said - it's not supposed to work/solve this problem 🤔 |
I know this might not help too much, but seeing as it's an Angular specific bug with an object literal might narrow down what's breaking somewhere. The code for SyntaxKind: or the kind in the original post being 188 is "ObjectLiteralExpression". From this code piece. https://github.com/Microsoft/TypeScript/blob/master/lib/typescriptServices.d.ts This will only help us maybe figure out why the parent is undefined from some ObjectLiteral in Angular. |
Any update ? |
have the exact issue with angular 7.2.10 and typescript 3.1.1 (had ts 3.2.4 before, and downgraded to 3.1.1 to see if it fixes the issue). |
Hey @volser and @yevgeni-eosos, thanks for the info! Unfortunately I'm still unable to repro 😕 Here's what I tried:
But no crashes. If anyone can share a repo or a zip file of a codebase that exhibits the issue, that would be 🌟 Thanks! |
I'm resolving this as an Angular bug (see angular/angular-cli#13861 ) - the call stack + debug print indicate that TS was given a With actual repro steps we could potentially investigate further on our side to help out, but as-is this is effectively a corrupted source tree and there's no issue on the TS side. |
A transformer should not mutate existing nodes, ever. If you intend to modify some part of the node, the ts.update* methods are correct. Or you can replace a node entirely via ts.create* operations, but there are cases where introducing entirely synthetic nodes will break TS output. Hence using the updateClassDeclaration in this case is the correct approach. This has also been raised in the slack #ts-core channel as TypeScript have been looking to get to the bottom of this microsoft/TypeScript#29365 (comment), which seemed to have been caused by mutating the node.
This problem happens to me when I am working on some feature in an angular project, and I must change the branch in the repository where all the files that the other branch does not have are deleted. |
I'm having the same problem. If you find a solution, I will be attentive! |
I'm also having the same problem. If you find a solution, I will be attentive! |
I had the same issue, but it was in my tsconfig.json. |
A transformer should not mutate existing nodes, ever. If you intend to modify some part of the node, the ts.update* methods are correct. Or you can replace a node entirely via ts.create* operations, but there are cases where introducing entirely synthetic nodes will break TS output. Hence using the updateClassDeclaration in this case is the correct approach. This has also been raised in the slack #ts-core channel as TypeScript have been looking to get to the bottom of this microsoft/TypeScript#29365 (comment), which seemed to have been caused by mutating the node.
TypeScript Version: 3.2.2
Search Terms:
Cannot read property 'kind' of undefined
I have found some results about this error but I haven't found anything about the problem where my project throws the error: "at getAssignmentTargetKind"
Code
I'm using angular 7.2.0 - the error first occured when I updated from 6.x to 7.x.
Also I tried creating a new project and just migrate everything file by file but since the error happens so randomly it's almost impossible to track down the file causing the problem :/
Here's the full error message:
I added this to typescript.js:
Here's the console.log
Expected behavior:
No errors
Actual behavior:
See above
Is there anything I can do to finally track down the file/code causing the error?
The text was updated successfully, but these errors were encountered: