Skip to content

Debug Failure. Unhandled Diagnostic: 2626Β #42773

Closed
@k-yle

Description

@k-yle

Bug Report

Regression in v4.2.1-rc (EDIT: also an issue in v4.2.2), tsc fails to compile with an error Debug Failure. Unhandled Diagnostic: 2626. It worked fine in v4.2.0-beta

πŸ”Ž Search Terms

πŸ•— Version & Regression Information

  • This is a crash
  • This changed between versions v4.2.1-beta and v4.2.2-rc
  • This is the behaviour in every version I tried, and I reviewed the FAQ for entries about "Debug Failure. Unhandled Diagnostic: 2626"
  • I was unable to test this on prior versions because _______

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

// I don't have a simple reproduction, this occurs in our ~60,000 SLOC codebase which is 50% Javascript using checkJs mode

tsconfig:

{
  "compilerOptions": {
    "target": "es5",
    "lib": ["dom", "dom.iterable", "es2020"],
    "allowJs": true,
    "checkJs": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "react-jsx",
    "noFallthroughCasesInSwitch": true,

    "downlevelIteration": true,
    "importHelpers": true,
    "strictNullChecks": true,
    "noImplicitAny": false,
    "baseUrl": "src"
  },
  "include": ["src"],

  "exclude": ["cypress", "src/**/__tests__/*.test.*"],
  "typeAcquisition": {
    "include": ["jest"],
    "exclude": ["chai", "cypress"]
  }
}

πŸ™ Actual behaviour

TSC crashes and fails to compile

$ yarn tsc --extendedDiagnostics

...\node_modules\typescript\lib\tsc.js:88040
                throw e;
                ^

Error: Debug Failure. Unhandled Diagnostic: 2626
    at reportIncompatibleStack (...\node_modules\typescript\lib\tsc.js:49104:45)
    at checkTypeRelatedTo (...\node_modules\typescript\lib\tsc.js:48976:17)
    at checkTypeRelatedToAndOptionallyElaborate (...\node_modules\typescript\lib\tsc.js:48255:24)
    at checkTypeAssignableToAndOptionallyElaborate (...\node_modules\typescript\lib\tsc.js:48249:20)
    at checkVariableLikeDeclaration (...\node_modules\typescript\lib\tsc.js:62811:25)
    at checkVariableDeclaration (...\node_modules\typescript\lib\tsc.js:62876:13)
    at checkSourceElementWorker (...\node_modules\typescript\lib\tsc.js:65151:28)
    at checkSourceElement (...\node_modules\typescript\lib\tsc.js:64999:17)
    at Object.forEach (...\node_modules\typescript\lib\tsc.js:128:30)
    at checkVariableStatement (...\node_modules\typescript\lib\tsc.js:62886:16)

πŸ™‚ Expected behaviour

It should compile, which worked in v4.2 beta

Metadata

Metadata

Assignees

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