Skip to content

getTypeFromTypeNodeWorker crashes with TypeError: Cannot read properties of undefined (reading 'kind')Β #50479

Description

Bug Report

πŸ”Ž Search Terms

"Cannot read properties of undefined", getInferredTypeParameterConstraint, getTypeFromTypeNodeWorker

πŸ•— Version & Regression Information

  • This is a crash
  • This changed between versions 4.7.4 and 4.8.2

⏯ Playground Link

TBD

πŸ’» Code

TBD

This is occurring in a private repo with a lot of code.

I plan to progressively delete code until I can whittle it down to a minimal repro but that may take several days so until then I thought I'd file this in case anyone has tips on where to start looking.

πŸ™ Actual behavior

❯ yarn build
yarn run v1.22.19
$ tsc
/home/birtles/referee/node_modules/typescript/lib/tsc.js:98394
                throw e;
                ^

TypeError: Cannot read properties of undefined (reading 'kind')
    at getTypeFromTypeNodeWorker (/home/birtles/referee/node_modules/typescript/lib/tsc.js:53060:26)
    at getTypeFromTypeNode (/home/birtles/referee/node_modules/typescript/lib/tsc.js:53057:49)
    at getEffectiveTypeArgumentAtIndex (/home/birtles/referee/node_modules/typescript/lib/tsc.js:68314:24)
    at Array.<anonymous> (/home/birtles/referee/node_modules/typescript/lib/tsc.js:50294:52)
    at getMappedType (/home/birtles/referee/node_modules/typescript/lib/tsc.js:53203:46)
    at instantiateTypeWorker (/home/birtles/referee/node_modules/typescript/lib/tsc.js:53516:24)
    at instantiateTypeWithAlias (/home/birtles/referee/node_modules/typescript/lib/tsc.js:53509:26)
    at instantiateType (/home/birtles/referee/node_modules/typescript/lib/tsc.js:53495:37)
    at _loop_15 (/home/birtles/referee/node_modules/typescript/lib/tsc.js:50296:58)
    at getInferredTypeParameterConstraint (/home/birtles/referee/node_modules/typescript/lib/tsc.js:50327:21)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

πŸ™‚ Expected behavior

Build succeeds.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions