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
TypeError: Cannot read properties of undefined (reading 'parent')
at eval (eval at getThisType (C:\projects\test\node_modules\typescript\lib\typescript.js:66507:7), <anonymous>:1:35)
at getThisType (C:\projects\test\node_modules\typescript\lib\typescript.js:66507:7)
at getTypeFromThisTypeNode (C:\projects\test\node_modules\typescript\lib\typescript.js:66518:28)
at getTypeFromTypeNodeWorker (C:\projects\test\node_modules\typescript\lib\typescript.js:66586:16)
at getTypeFromTypeNode (C:\projects\test\node_modules\typescript\lib\typescript.js:66552:41)
at getReturnTypeFromAnnotation (C:\projects\test\node_modules\typescript\lib\typescript.js:63200:14)
at checkFunctionExpressionOrObjectLiteralMethodDeferred (C:\projects\test\node_modules\typescript\lib\typescript.js:82410:24)
at checkDeferredNode (C:\projects\test\node_modules\typescript\lib\typescript.js:89929:9)
at Set.forEach (<anonymous>)
at checkDeferredNodes (C:\projects\test\node_modules\typescript\lib\typescript.js:89907:27)
🙂 Expected behavior
When I remove the JSDoc or I extend the prototype of a known object, this does not crash. I would expect checker.getSuggestionDiagnostics(sourceFile) to return an empty array.
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered:
Unfortunately it's pretty easy to hold the compiler API the wrong way and cause weird exceptions. We need a complete runnable standalone repro in order to investigate.
vdiez
added a commit
to vdiez/tsc_repro
that referenced
this issue
Feb 27, 2025
🔎 Search Terms
tsc: "Cannot read properties of undefined (reading 'parent')" getThisType getSuggestionDiagnostics
🕗 Version & Regression Information
⏯ Playground Link
No response
💻 Code
I have an ESLint rule where I'm getting the TS diagnostics to report deprecations.
While linting a project with JS code, the rule crashes. I managed to get the very minimum reproducer with a TS program with this file:
and a tsconfig.json with the following contents:
🙁 Actual behavior
It crashes with error:
🙂 Expected behavior
When I remove the JSDoc or I extend the prototype of a known object, this does not crash. I would expect
checker.getSuggestionDiagnostics(sourceFile)
to return an empty array.Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: