-
Notifications
You must be signed in to change notification settings - Fork 12.8k
TypeError: Cannot read property 'valueDeclaration' of undefined (continuation) #35801
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
Comments
@evenfrost @arian @BernsteinA @elibarzilay new issue here |
@jasonwilliams how do we reproduce the issue? |
@RyanCavanaugh thats what a few of us are trying to work out, this is happening on a large private repo which isn’t useful to you so the best I can provide is a stack trace. From the last issue we are trying to narrow this down. |
I've narrowed down the issue and it appears when using |
So after 4 hours of digging I've finally tracked down the issue (for me at least). TL;DR: You should explicitly specify Long story: I'm using Don't know why it was working on TypeScript 3.6, but 3.7 release became really unhappy with it. |
First off Happy New Year, back to debugging this. @evenfrost explicitly specifying the Update: Also, i have a better stack trace
Using |
I've ran git bisect against commits between The offending commit seems to be this one @RyanCavanaugh does any of this help? |
@jasonwilliams here's mine: {
"extends": "./tsconfig.base.json",
"compilerOptions": {
"allowJs": true,
"baseUrl": ".",
"paths": {
"@/*": [
"./*"
]
},
"module": "commonjs",
"outDir": "./build",
"rootDir": "./",
"target": "es2019"
},
"exclude": [
"./build/**/*",
"./client/**/*",
"node_modules",
"**/node_modules/*"
]
} Content of {
"compilerOptions": {
"allowUnreachableCode": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": false,
"removeComments": true,
"sourceMap": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true
}
} |
Thanks I’ll compare against mine @evenfrost did you try setting useTypescriptIncrementalApi: false in your typescript checker settings? |
The stack trace might be enough to go on. We'll give it a shot. |
@RyanCavanaugh @rbuckton i've managed to create a test case here: |
Hi there, I also created minimal set for the reproduction.
It throws like:
My tsc is v3.8.3. I hope this helps you. |
This may be related to #36273. |
@weswigham I have a fix for the crash, but I'm not sure I like the JS declaration emit for @acomagu's example: // js
let A;
A = {};
A.prototype.b = {};
// .d.ts
declare class A {
b: {};
} The binder declares |
I'm thinking about something like this: function isEffectiveClassSymbol(symbol: Symbol) {
if (!(symbol.flags & SymbolFlags.Class)) {
return false;
}
if (isInJSFile(symbol.valueDeclaration) && !isClassLike(symbol.valueDeclaration)) {
// For a symbol that isn't syntactically a `class` in a JS file we have heuristics
// that detect prototype assignments that indicate the symbol is *probably* a class.
// Filter out any prototype assignments for non-class symbols, i.e.
//
// let A;
// A = {};
// A.prototype.b = {};
const type = getTypeOfSymbol(symbol);
return some(getSignaturesOfType(type, SignatureKind.Construct))
|| some(getSignaturesOfType(type, SignatureKind.Call));
}
return true;
} |
Hmm, seems reasonable. |
One note: not sure if this was stated, but I only ran into this issue with using |
Also seeing something similar when converting a vanilla js (does use jsdoc) project over to ts
downgrading to |
This was fixed in #38508. |
This is a continuation of #34869
I'm still getting the error testing against
v3.8.0-dev.20191205
Here is my stack trace (the first one is react-styleguidist)
Related Issues:
#34869
The text was updated successfully, but these errors were encountered: