Repository navigation
Cannot read properties of undefined (reading 'length') #51623
Copy link
Copy link
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
Activity
nicolas377 commented
on Nov 22, 2022 ContributorMore actions- addedBugA bug in TypeScriptA bug in TypeScriptCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad output
on Nov 23, 2022 Andarist commented
on Nov 23, 2022 ContributorMore actionsThis particular error goes away with this patch (unfortunately, it breaks other things though):
diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 92a989a2bc..394fa24674 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -14901,7 +14901,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const resolved = resolveAlias(aliasSymbol); if (resolved && resolved.flags & SymbolFlags.TypeAlias) { newAliasSymbol = resolved; - aliasTypeArguments = typeArgumentsFromTypeReferenceNode(node); + aliasTypeArguments = getTypeArgumentsForAliasSymbol(newAliasSymbol); } } }
I'm not entirely sure if this patch produces a correct result for this test case as I'm not entirely sure what to expect out of the
.typesand.symbolssnapshots here. It compiles and doesn't produce any errors though.- added a commit that references this issue
on Dec 5, 2022 - addedFix AvailableA PR has been opened for this issueA PR has been opened for this issue
on Dec 5, 2022 - added a commit that references this issue
on Dec 5, 2022 - locked as resolved and limited conversation to collaborators
on Oct 22, 2025
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Bug Report
🔎 Search Terms
Cannot read properties of undefined, tsc crash
🕗 Version & Regression Information
First noticed on 5.0.0-dev.20221118 nightly build, persists on 5.0.0-dev.20221122
⏯ Playground Link
https://www.typescriptlang.org/play?module=1&ts=5.0.0-dev.20221122#code/KYDwDg9gTgLgBDAnmYcBiEIB4AqcC8cAzjFAJYB2A5gHwFwDeAvgNwBQbA9J3AAIBmZADbAKAQwC2wAFxxBIgEwA6GEQ5kJkWIwwQmcqBAlwA5Es6UwAVxgn2bflYoBjGGQgU4AIzFRcNAApgESkKGFldAEpGNjg4KGAYKyhPAEZ2Jg4fKADUuDEidEwsCisJL2AoGkiWIA
💻 Code
🙁 Actual behavior
A crash:
🙂 Expected behavior
Success or compilation errors.