Skip to content

Disable tsc incremental compilation to prevent stale cache phantom errors#2277

Merged
hiroshinishio merged 1 commit intomainfrom
wes
Feb 19, 2026
Merged

Disable tsc incremental compilation to prevent stale cache phantom errors#2277
hiroshinishio merged 1 commit intomainfrom
wes

Conversation

@hiroshinishio
Copy link
Collaborator

@hiroshinishio hiroshinishio commented Feb 19, 2026

Summary

  • Pass --incremental false to tsc to disable incremental compilation, preventing stale .tsbuildinfo cache from causing phantom errors (e.g. reporting errors at line 73 in a 64-line file)
  • The customer's tsconfig.json had "incremental": true, so tsc creates .tsbuildinfo on every run. Once stale, subsequent runs report phantom errors from cached file state
  • Added test verifying --incremental false flag is present in the tsc command

Test plan

  • All 11 tsc tests pass including new test_run_tsc_check_disables_incremental
  • pylint 10.00/10, pyright 0 errors, flake8 clean

Social Media Post (GitAuto)

A customer's tsconfig.json had "incremental": true. tsc caches compilation state in .tsbuildinfo files. When GitAuto's agent rewrites a file between verification runs, tsc reads the stale cache and reports phantom errors - like "error at line 73" in a 64-line file. The agent rewrote correct code 7 times chasing a ghost. Fix: override with --incremental false on every tsc check.

Social Media Post (Wes)

tsc reported "syntax error at line 73." The file was 64 lines. Checked the code - it was correct. The customer's tsconfig had "incremental": true, so tsc cached compilation state in .tsbuildinfo. Between rewrites, the cache went stale and tsc kept checking against a ghost version of the file. 7 attempts, all correct, all "failed." --incremental false on our tsc check. Done.

@hiroshinishio hiroshinishio self-assigned this Feb 19, 2026
@hiroshinishio hiroshinishio merged commit f1bce92 into main Feb 19, 2026
1 check passed
@hiroshinishio hiroshinishio deleted the wes branch February 19, 2026 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant