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
Cannot read property 'parent' of undefined in collectEnclosingScopes #30528
Comments
The only place this could happen in the code is here: while (true) {
current = current.parent;
// A function parameter's initializer is actually in the outer scope, not the function declaration
if (current.kind === SyntaxKind.Parameter) {
// Skip all the way to the outer scope of the function that declared this parameter
current = findAncestor(current, parent => isFunctionLikeDeclaration(parent))!.parent;
} I'm guessing we found a parameter inside a JSDoc near the top level and then tried to walk up to the enclosing function decl, but didn't find one and bottomed out.
|
I got a similar error: Version: typescript 3.7.0-dev.20191017
|
I also received a similar error: TypeScript Versions: No error occurs TypeError: Cannot read property 'parent' of undefined
at Object.getDeclarationOfExpando (/<redacted>/node_modules/typescript/lib/tsc.js:8604:19)
at getTypeOfFuncClassEnumModule (/<redacted>/node_modules/typescript/lib/tsc.js:32596:40)
at getTypeOfSymbol (/<redacted>/node_modules/typescript/lib/tsc.js:32702:24)
at getExternalModuleMember (/<redacted>/node_modules/typescript/lib/tsc.js:28512:64)
at getTargetOfExportSpecifier (/<redacted>/node_modules/typescript/lib/tsc.js:28557:17)
at getTargetOfAliasDeclaration (/<redacted>/node_modules/typescript/lib/tsc.js:28600:28)
at resolveAlias (/<redacted>/node_modules/typescript/lib/tsc.js:28633:30)
at resolveSymbol (/<redacted>/node_modules/typescript/lib/tsc.js:28623:67)
at getSymbolIfSameReference (/<redacted>/node_modules/typescript/lib/tsc.js:29170:33)
at /<redacted>/node_modules/typescript/lib/tsc.js:29164:21 |
Closing as out of date |
TypeScript Version: 3.4.0-rc
Bug
While editing some code in VS Code, I saw this error. Sorry no repo steps yet
The text was updated successfully, but these errors were encountered: