Skip to content

TS6059 error count flakes between runs unless --singleThreaded #64477

Description

🔎 Search Terms

TS6059, rootDir, flaky error count, singleThreaded

🕗 Version & Regression Information

seeing it on 7.0.2 and on main (4f5ddae). havent tried older versions

⏯ Playground Link

No response

💻 Code

repros on material-ui's docs project (the mui-docs scenario in typescript-benchmarking):

git clone https://github.com/mui/material-ui.git
cd material-ui
git checkout 190a83cf3784c53b57d7a80cf96df27276eed079
pnpm install --ignore-scripts
for i in 1 2 3 4 5 6; do
  npx -p typescript@7.0.2 tsc -p docs --outDir /tmp/out --pretty false | grep -c 'error TS'
done

tried to get a small repro (tsconfig paths pointing outside rootDir, a JS barrel re-exporting TS files outside rootDir) but everything i tried was stable

🙁 Actual behavior

the error count changes between runs of the exact same command. on 7.0.2 i got 11378, 11405, 11401, 11405, 11405, 11400. almost all of them are TS6059 (File '…' is not under 'rootDir' 'docs')

with --singleThreaded its 11403 every time. --checkers 1 still flakes so i think it's coming from loading files in parallel and not from the checkers

the ones that go missing are reported inside other files that are also outside rootDir, e.g.

packages/mui-system/src/borders/index.ts(1,25): error TS6059: File 'packages/mui-system/src/borders/borders.ts' is not under 'rootDir' 'docs'. 'rootDir' is expected to contain all source files.

the "The file is in the program because:" lists also come out in a different order each run

🙂 Expected behavior

same errors every run, same as --singleThreaded

Additional information about the issue

my guess is each file only gets one TS6059, reported at whichever import got recorded first, and that depends on which files finished loading first. when that import is in a file whose errors dont get reported the error just disappears. couldnt confirm it with a small repro though so i might have the trigger wrong

found this while benchmarking #64474, used claude code to help track it down

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions