You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before we had no-object-literal-type-assertion applied, there were a lot of suspicious casts.
These have all been labeled with comments containing the text GH#18217.
What's the best way to proceed? It looks like it would be relatively straightforward to add a check, but do I need to create a repro case to show it's a real issue? Should I open another issue and link to this one? Please advise.
This issue was a catch-all for eventually removing every postfix !. Please open a new issue outlining how to repro the problem you encountered. Thanks!
when you change a character in "prototype" or "get" and wait for type inference to activate, then this error appears in the devtools in code-insiders
getTypeParametersForTypeReference return undefined, that then causes this error
Cannot read property '1' of undefined
TypeError: Cannot read property '1' of undefined
at getTypeArgumentConstraint (c:\Users\matth.vscode-insiders\extensions\ms-vscode.vscode-typescript-next-4.5.20210901\node_modules\typescript\lib\tsserver.js:76890:73)
at Object.getTypeArgumentConstraint (c:\Users\matth.vscode-insiders\extensions\ms-vscode.vscode-typescript-next-4.5.20210901\node_modules\typescript\lib\tsserver.js:46205:32)
at getStringLiteralCompletionEntries (c:\Users\matth.vscode-insiders\extensions\ms-vscode.vscode-typescript-next-4.5.20210901\node_modules\typescript\lib\tsserver.js:125267:108)
at Object.getStringLiteralCompletions (c:\Users\matth.vscode-insiders\extensions\ms-vscode.vscode-typescript-next-4.5.20210901\node_modules\typescript\lib\tsserver.js:125173:35)
It looks like custom transformers (at least those hooked into the before phase) can't successfully create new get/set accessor nodes due to an invalid non-null assertion at the very top of compiler > checker > createTypeChecker > createResolver > getAllAccessorDeclarations. Reproduced in 4.8.4, but the assertion is still there on main currently.
Danny McGee (@dannymcgee) Would you mind filing a new issue for that, especially if you have a simple transformer that shows the bug? We can add those as unit tests.
(As with #18217 (comment) this issue isn't really the right place to report isuses.)
Activity
moduleNameResolver: fix invalid assertion and avoid unnecessary work
moduleNameResolver: fix invalid assertion and avoid unnecessary work (#…
WORMSS commentedon Sep 13, 2019
So.. I kinda hit this today on
https://github.com/microsoft/TypeScript/blob/master/src/services/services.ts#L265
edsrzf commentedon Dec 13, 2020
I've run into an exception thrown by this line, which has a comment referencing this issue:
TypeScript/src/services/codefixes/fixCannotFindModule.ts
Line 55 in 6bcb6bb
What's the best way to proceed? It looks like it would be relatively straightforward to add a check, but do I need to create a repro case to show it's a real issue? Should I open another issue and link to this one? Please advise.
RyanCavanaugh commentedon Dec 14, 2020
This issue was a catch-all for eventually removing every postfix
!. Please open a new issue outlining how to repro the problem you encountered. Thanks!mjz19910 commentedon Sep 2, 2021
got an undefined in tsserver version 4.5.20210901
when you change a character in "prototype" or "get" and wait for type inference to activate, then this error appears in the devtools in code-insiders
getTypeParametersForTypeReferencereturn undefined, that then causes this errorCannot read property '1' of undefined
TypeError: Cannot read property '1' of undefined
at getTypeArgumentConstraint (c:\Users\matth.vscode-insiders\extensions\ms-vscode.vscode-typescript-next-4.5.20210901\node_modules\typescript\lib\tsserver.js:76890:73)
at Object.getTypeArgumentConstraint (c:\Users\matth.vscode-insiders\extensions\ms-vscode.vscode-typescript-next-4.5.20210901\node_modules\typescript\lib\tsserver.js:46205:32)
at getStringLiteralCompletionEntries (c:\Users\matth.vscode-insiders\extensions\ms-vscode.vscode-typescript-next-4.5.20210901\node_modules\typescript\lib\tsserver.js:125267:108)
at Object.getStringLiteralCompletions (c:\Users\matth.vscode-insiders\extensions\ms-vscode.vscode-typescript-next-4.5.20210901\node_modules\typescript\lib\tsserver.js:125173:35)
Remove now-outdated non-null comment around #18217.
Update to TypeScript 4.5.5, fix semantic lints. (#47529)
dannymcgee commentedon Feb 17, 2023
It looks like custom transformers (at least those hooked into the
beforephase) can't successfully create new get/set accessor nodes due to an invalid non-null assertion at the very top ofcompiler > checker > createTypeChecker > createResolver > getAllAccessorDeclarations. Reproduced in 4.8.4, but the assertion is still there onmaincurrently.jakebailey commentedon Feb 17, 2023
Danny McGee (@dannymcgee) Would you mind filing a new issue for that, especially if you have a simple transformer that shows the bug? We can add those as unit tests.
(As with #18217 (comment) this issue isn't really the right place to report isuses.)