Skip to content

Error: Debug Failure. False expression: Semantic diagnostics shouldnt be available for changed files #50222

Description

Bug Report

I was testing the correctness of watch mode in TypeScript 4.7.4 with a patch applied (see #7317, which I am using on top of 4.7.4 until I move to 4.8 which has #48997) when I came across this crash.

The test was performed on a large mono repo. I would checkout two branches that had hundreds of commits in between each other (some of which updated package.json), but both were on the same version of TypeScript. After completing a checkout, I would run yarn install.

This is the crash:

[12:10:24 PM] File change detected. Starting incremental compilation...

.../node_modules/.store/typescript-patch-7583448d64/node_modules/typescript/lib/tsc.js:2099
            throw e;
            ^

Error: Debug Failure. False expression: Semantic diagnostics shouldnt be available for changed files
    at createBuilderProgramState (.../node_modules/.store/typescript-patch-7583448d64/node_modules/typescript/lib/tsc.js:99177:26)
    at Object.createBuilderProgram (.../node_modules/.store/typescript-patch-7583448d64/node_modules/typescript/lib/tsc.js:99738:21)
    at createEmitAndSemanticDiagnosticsBuilderProgram (.../node_modules/.store/typescript-patch-7583448d64/node_modules/typescript/lib/tsc.js:100051:19)
    at Object.host.createProgram (.../node_modules/.store/typescript-patch-7583448d64/node_modules/typescript/lib/tsc.js:104732:20)
    at createProgram (.../node_modules/.store/typescript-patch-7583448d64/node_modules/typescript/lib/tsc.js:103181:28)
    at executeSteps (.../node_modules/.store/typescript-patch-7583448d64/node_modules/typescript/lib/tsc.js:103330:25)
    at Object.done (.../node_modules/.store/typescript-patch-7583448d64/node_modules/typescript/lib/tsc.js:103150:13)
    at Timeout.buildNextInvalidatedProject [as _onTimeout] (.../node_modules/.store/typescript-patch-7583448d64/node_modules/typescript/lib/tsc.js:103873:32)

🔎 Search Terms

semantic diagnostics shouldnt be available for changed files

🕗 Version & Regression Information

4.7.4 with patch applied (see bug description above)

  • This is a crash
  • I was unable to test this on prior versions because watch mode has been undergoing a lot of changes, I'm not sure how relevant it would be.

🙁 Actual behavior

Crash with Semantic diagnostics shouldnt be available for changed files

🙂 Expected behavior

No crash, settle down and eventually typescript completely passes without needing to restart typescript

Activity

  1. sheetalkamat commented on Sep 23, 2022

    @sheetalkamat
    Member

    Is this still repoing.. if yes we would need repro steps (preferably) otherwise extendedDiagnostics logs that you can send us and based on that we would need to see how to take this forward.. Its completely based on state so its not easy to figure out why should get that assert just by looking at code.

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

Metadata

Metadata

Labels

Needs More InfoThe issue still hasn't been fully clarifiedRescheduledThis issue was previously scheduled to an earlier milestone

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions