TypeScript: Debug Failure. False expression.

TypeScript Version: 2.6.0-dev.20170904

Trace:

/usr/local/lib/node_modules/typescript/lib/tsc.js:56399
                throw e;
                ^

Error: Debug Failure. False expression.
    at createTypeMapper (/usr/local/lib/node_modules/typescript/lib/tsc.js:24927:22)
    at checkTypeArguments (/usr/local/lib/node_modules/typescript/lib/tsc.js:30509:38)
    at resolveCall (/usr/local/lib/node_modules/typescript/lib/tsc.js:30794:17)
    at resolveCallExpression (/usr/local/lib/node_modules/typescript/lib/tsc.js:30962:20)
    at resolveSignature (/usr/local/lib/node_modules/typescript/lib/tsc.js:31138:28)
    at getResolvedSignature (/usr/local/lib/node_modules/typescript/lib/tsc.js:31158:26)
    at checkCallExpression (/usr/local/lib/node_modules/typescript/lib/tsc.js:31201:29)
    at checkExpressionWorker (/usr/local/lib/node_modules/typescript/lib/tsc.js:32490:28)
    at checkExpression (/usr/local/lib/node_modules/typescript/lib/tsc.js:32430:42)
    at checkExpressionCached (/usr/local/lib/node_modules/typescript/lib/tsc.js:32346:38)
    at getTypeOfExpression (/usr/local/lib/node_modules/typescript/lib/tsc.js:32415:28)
    at checkDeclarationInitializer (/usr/local/lib/node_modules/typescript/lib/tsc.js:32356:24)
    at getTypeForVariableLikeDeclaration (/usr/local/lib/node_modules/typescript/lib/tsc.js:21839:28)
    at getWidenedTypeForVariableLikeDeclaration (/usr/local/lib/node_modules/typescript/lib/tsc.js:21954:24)
    at getTypeOfVariableOrParameterOrProperty (/usr/local/lib/node_modules/typescript/lib/tsc.js:22002:28)
    at checkVariableLikeDeclaration (/usr/local/lib/node_modules/typescript/lib/tsc.js:34111:41)
    at checkVariableDeclaration (/usr/local/lib/node_modules/typescript/lib/tsc.js:34161:20)
    at checkSourceElement (/usr/local/lib/node_modules/typescript/lib/tsc.js:35739:28)
    at Object.forEach (/usr/local/lib/node_modules/typescript/lib/tsc.js:275:30)
    at checkVariableStatement (/usr/local/lib/node_modules/typescript/lib/tsc.js:34169:16)
    at checkSourceElement (/usr/local/lib/node_modules/typescript/lib/tsc.js:35708:28)
    at Object.forEach (/usr/local/lib/node_modules/typescript/lib/tsc.js:275:30)
    at checkSourceFileWorker (/usr/local/lib/node_modules/typescript/lib/tsc.js:35812:20)
    at checkSourceFile (/usr/local/lib/node_modules/typescript/lib/tsc.js:35797:13)
    at getDiagnosticsWorker (/usr/local/lib/node_modules/typescript/lib/tsc.js:35850:17)
    at Object.getDiagnostics (/usr/local/lib/node_modules/typescript/lib/tsc.js:35839:24)
    at /usr/local/lib/node_modules/typescript/lib/tsc.js:56414:85
    at runWithCancellationToken (/usr/local/lib/node_modules/typescript/lib/tsc.js:56392:24)
    at getSemanticDiagnosticsForFileNoCache (/usr/local/lib/node_modules/typescript/lib/tsc.js:56406:20)
    at getAndCacheDiagnostics (/usr/local/lib/node_modules/typescript/lib/tsc.js:56614:26)
    at getSemanticDiagnosticsForFile (/usr/local/lib/node_modules/typescript/lib/tsc.js:56403:20)
    at /usr/local/lib/node_modules/typescript/lib/tsc.js:56360:24
    at Object.flatMap (/usr/local/lib/node_modules/typescript/lib/tsc.js:507:25)
    at getDiagnosticsHelper (/usr/local/lib/node_modules/typescript/lib/tsc.js:56356:56)
    at Object.getSemanticDiagnostics (/usr/local/lib/node_modules/typescript/lib/tsc.js:56367:20)
    at compileProgram (/usr/local/lib/node_modules/typescript/lib/tsc.js:59366:43)
    at compile (/usr/local/lib/node_modules/typescript/lib/tsc.js:59323:26)
    at performCompilation (/usr/local/lib/node_modules/typescript/lib/tsc.js:59212:33)
    at Object.executeCommandLine (/usr/local/lib/node_modules/typescript/lib/tsc.js:59155:9)
    at Object.<anonymous> (/usr/local/lib/node_modules/typescript/lib/tsc.js:59513:4)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/typescript/bin/tsc:2:1)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Function.Module.runMain (module.js:605:10)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:575:3

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (5 by maintainers)

Commits related to this issue

Most upvoted comments

I have same error when compilerOptions.pretty = true

 ✘  ~/projects/my-nextjs-typescript-boilerplate   master ●  yr dev:ts
yarn run v0.28.4
$ tsc --watch
/home/bjorn/projects/my-nextjs-typescript-boilerplate/node_modules/typescript/lib/tsc.js:2062
            throw e;
            ^

Error: Debug Failure. False expression.
    at computePositionOfLineAndCharacter (/home/bjorn/projects/my-nextjs-typescript-boilerplate/node_modules/typescript/lib/tsc.js:3752:22)
    at Object.getPositionOfLineAndCharacter (/home/bjorn/projects/my-nextjs-typescript-boilerplate/node_modules/typescript/lib/tsc.js:3742:16)
    at Object.formatDiagnosticsWithColorAndContext (/home/bjorn/projects/my-nextjs-typescript-boilerplate/node_modules/typescript/lib/tsc.js:55575:59)
    at reportDiagnosticWithColorAndContext (/home/bjorn/projects/my-nextjs-typescript-boilerplate/node_modules/typescript/lib/tsc.js:58771:25)
    at reportDiagnostic (/home/bjorn/projects/my-nextjs-typescript-boilerplate/node_modules/typescript/lib/tsc.js:58733:9)
    at reportDiagnostics (/home/bjorn/projects/my-nextjs-typescript-boilerplate/node_modules/typescript/lib/tsc.js:58738:13)
    at compileProgram (/home/bjorn/projects/my-nextjs-typescript-boilerplate/node_modules/typescript/lib/tsc.js:59099:13)
    at compile (/home/bjorn/projects/my-nextjs-typescript-boilerplate/node_modules/typescript/lib/tsc.js:59051:26)
    at performCompilation (/home/bjorn/projects/my-nextjs-typescript-boilerplate/node_modules/typescript/lib/tsc.js:58940:33)
    at Object.executeCommandLine (/home/bjorn/projects/my-nextjs-typescript-boilerplate/node_modules/typescript/lib/tsc.js:58883:9)
    at Object.<anonymous> (/home/bjorn/projects/my-nextjs-typescript-boilerplate/node_modules/typescript/lib/tsc.js:59241:4)
    at Module._compile (module.js:573:30)
    at Object.Module._extensions..js (module.js:584:10)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)
    at Module.require (module.js:517:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/bjorn/projects/my-nextjs-typescript-boilerplate/node_modules/typescript/bin/tsc:2:1)
    at Module._compile (module.js:573:30)
    at Object.Module._extensions..js (module.js:584:10)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)
    at Function.Module.runMain (module.js:609:10)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:598:3
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

project state

@spencerhakim can you give typescript@next a try an let us know if you see the same crash? also can you share the project where this issue happens? we would be happy to sign any NDA required to get access to the sources. also you could fire the compiler under node --inspect-brk node_modules/typescript/lib/tsc.js --p <tsconfig.json> and at the location of the crash, in checkCallExpression on the stack, get call getSourceFileOfNode(node) and that should tell you the file where the compiler is crashing, and inspecting the node should give you the position and the call target, so you can narrow down the source of the crash, and hopefully be able to reduce the repro.