tsc --watch never recompiles on macOS since 7.1.0-dev.20260811.1

Aperta
#64,351 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go, macos, typescript

Direzione di ricerca

Start with the provided macOS shell repro using tsc --watch, then compare behavior between the last good and first bad nightly. Inspect the watch-mode changes in the listed regression commits, especially the macOS realpath change, and verify that edits, new files, tsconfig changes, and deletions trigger recompilation with the expected diagnostic.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

🔎 Search Terms
  • --watch never recompiles
  • tsc --watch macOS no file change detected
  • --build --watch macOS regression 7.1.0-dev.20260811.1
🕗 Version & Regression Information
  • Broken in every nightly from 7.1.0-dev.20260811.1 through 7.1.0-dev.20260919.1 (@typescript/typescript-darwin-x64)
  • Works in 7.1.0-dev.20260810.1 and in @typescript/native-preview 7.0.0-dev.20260707.2
  • Bisected across the published nightlies: last good 7.1.0-dev.20260810.1 (published 2026-08-10T08:17Z), first bad 7.1.0-dev.20260811.1 (published 2026-08-11T08:18Z)
  • macOS 26.6.2 (x64, APFS); TypeScript 5.9.3 tsc --watch works in the same shell

Commits on main between the two nightly builds:

  • 40af284bf Handle extensionless root files gracefully instead of panicking (microsoft/typescript-go#4628)
  • 5cad7ecba Fall back to inotify when filesystem has errors in fanotify (fix watch in Docker) (microsoft/typescript-go#4661)
  • b7045b4c0 Fix watch diagnostics when global declaration is removed (microsoft/typescript-go#4848)
  • 1adcc6258 Preserve await context for exported classes in nested containers (microsoft/typescript-go#4823)
  • 3c315b7dd Account nested declaration emits as emit time (microsoft/typescript-go#4557)
  • a649b1fd4 Remove macOS realpath fast path (microsoft/typescript-go#4867)
  • bbf7371f5 Port transpileModule, transpileDeclaration (microsoft/typescript-go#4849)
  • 56244ebe9 Split heritage clause expression and type nodes (microsoft/typescript-go#4797)
⏯ Playground Link

n/a (watch mode)

💻 Code
mkdir repro && cd repro
echo '{ "compilerOptions": { "strict": true, "noEmit": true }, "include": ["*.ts"] }' > tsconfig.json
echo 'export const a: number = 1;' > a.ts
tsc --watch --pretty false &
sleep 2
echo 'export const a: number = "x";' > a.ts
sleep 10
🙁 Actual behavior
11:33:16 AM - Starting compilation in watch mode...

11:33:16 AM - Found 0 errors. Watching for file changes.

Nothing else is ever printed. The edited file is not re-checked and TS2322 never appears. A second edit, creating a new b.ts, editing tsconfig.json and deleting a file are all ignored as well. tsc --build --watch behaves the same.

Things that make no difference:

  • --watchFile fixedpollinginterval, dynamicprioritypolling, prioritypollinginterval, usefseventsonparentdirectory (and --watchDirectory fixedpollinginterval): the options are accepted, the behaviour is identical
  • Directory shape: an all-lowercase directory with no symlink in its path (/private/tmp/tsrx-watch-lower), a mixed-case one (/private/tmp/tsrx-Watch-Upper), a path through the /tmp symlink, a path under $HOME, and a firmlink-prefixed path (/System/Volumes/Data/...) all fail the same way
  • stdin: closed (/dev/null) or kept open as a pipe
  • With or without a content mapper in the project

So this looks different from #64089 (dropped FSEvents when casing differs), although the regression window contains the realpath change that issue mentions (a649b1fd4).

On 7.1.0-dev.20260810.1 the same steps print File change detected. Starting incremental compilation... and the TS2322 error about 2 seconds after the edit.

🙂 Expected behavior

Watch mode recompiles after the edit and reports the error, as 7.1.0-dev.20260810.1 and TypeScript 5.9 do.

Additional information about the issue

Only macOS was tested (Intel, macOS 26.6.2). Found while building the .tsrx content mapper for TSRX (tsrx-org/tsrx#41), where the --watch test can only assert the initial compilation.

Lingua principale
Go
Stelle
111k
Fork
14.4k
Merge medio
1g 15h
PR unite (30g)
106

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/TypeScript

Tutte le issue di microsoft/TypeScript

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.