Repository navigation
Description
🔎 Search Terms
--watchnever recompilestsc --watchmacOS no file change detected--build --watchmacOS regression7.1.0-dev.20260811.1
🕗 Version & Regression Information
- Broken in every nightly from
7.1.0-dev.20260811.1through7.1.0-dev.20260919.1(@typescript/typescript-darwin-x64) - Works in
7.1.0-dev.20260810.1and in@typescript/native-preview7.0.0-dev.20260707.2 - Bisected across the published nightlies: last good
7.1.0-dev.20260810.1(published 2026-08-10T08:17Z), first bad7.1.0-dev.20260811.1(published 2026-08-11T08:18Z) - macOS 26.6.2 (x64, APFS); TypeScript 5.9.3
tsc --watchworks in the same shell
Commits on main between the two nightly builds:
- 40af284 Handle extensionless root files gracefully instead of panicking (Handle extensionless root files gracefully instead of panicking typescript-go#4628)
- 5cad7ec Fall back to inotify when filesystem has errors in fanotify (fix watch in Docker) (Fall back to inotify when filesystem has errors in fanotify (fix watch in Docker) typescript-go#4661)
- b7045b4 Fix watch diagnostics when global declaration is removed (Fix watch diagnostics when global declaration is removed typescript-go#4848)
- 1adcc62 Preserve await context for exported classes in nested containers (Preserve await context for exported classes in nested containers typescript-go#4823)
- 3c315b7 Account nested declaration emits as emit time (Account nested declaration emits as emit time typescript-go#4557)
- a649b1f Remove macOS realpath fast path (Remove macOS realpath fast path typescript-go#4867)
- bbf7371 Port transpileModule, transpileDeclaration (Port transpileModule, transpileDeclaration typescript-go#4849)
- 56244eb Split heritage clause expression and type nodes (Split heritage clause expression and type nodes 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/tmpsymlink, 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 (a649b1f).
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.
Activity
jakebailey commentedon Sep 22, 2026
Can you try #64210 just to see?
leonidaz commentedon Sep 22, 2026
Jake Bailey (@jakebailey) Ok, tried it out and it works with #64210
Including a report below on the run, might be helpful.
TypeScript PR #64210 watch verification
Date: 2026-09-22. Tested locally on macOS 26.6.2 (25G83), Intel x86_64, APFS, MacBookPro16,1; Node v24.18.0.
PR #64210 fixes the observed watch regression for this TSRX branch in the exercised scenarios. All 44 edit checks passed, across plain TypeScript and the current TSRX content mapper, in both
--watchand--build --watch.Exact sources
feat/content-mapper-41at9a59b3be2121d409eafac4feb7f8fe3cf6956ced.90385b50d5ff3d607ed3260314010ad5ca64a024(2026-09-21 head).1ac2d5aed0bf19626a75f5424a80980573dead7d(second parent of the PR head).Both source builds use Go 1.27.1,
CGO_ENABLED=0, and the build command below, matchingHerebyfile.mjs. Each build uses its own source library declaration files. Go build metadata verifies the PR revision andvcs.modified=false.Results
.tswatch.tsbuild/watchThe upstream base built from source also failed all four scenarios, with no output after the first source edit. This isolates the successful behavior to the PR changes rather than unrelated upstream changes or the local toolchain.
The pinned nightly completed each initial compilation with zero errors but never reported a file change or TS2322 after the first source edit, with a 15-second wait. Classic TypeScript 5.9.3 passed all 16 plain TypeScript edit checks in the same harness/environment.
The PR passed 8 edits per plain TypeScript scenario and 14 edits per TSRX scenario (44 total). Detection plus completed diagnostics for TSRX edits ranged from 50–403 ms in the confirmed run; this is a smoke-test observation, not a benchmark.
What the live edits exercised
Plain TypeScript, in both modes:
strictin tsconfig to clear it, restorestrictto report it again, then fix the source.TSRX, in both modes:
Button.tsrx.<script>body inPanel.tsrx.Panel.tsrx; confirm a dependentmain.tsdiagnostic appears and clears when restored.tsrx1000, then recover to zero errors..tsrxfile; confirm its error appears/clears..tsrxfile; confirm TS2307 appears/clears.tsrx.compilerin an extended config; confirm mapper errors (tsrx1002) appear/clear.Fixtures are generated with the branch's
consumer_fixture_files()andcreate_native_workspace(). The mapper is launched from the branch'spackages/content-mapper/src/server.js, with the workspace target compiler and React types. No published or stale mapper bundle is substituted. Watch uses actual disk changes and native filesystem notifications, with stdin closed. The watch/build fixture is a single project; project-reference behavior is covered by the existing one-shot build tests, not a live multi-project watch test.Existing branch tests
The following passed with the PR binary: 3 test files, 12 tests.
TSRX_NATIVE_TSC=/private/tmp/tsrx-pr64210-aujbxqwo/typescript/built/local/tsc \ pnpm test --project content-mapper \ packages/content-mapper/tests/native-tsc.test.js \ packages/content-mapper/tests/native-build.test.js \ packages/content-mapper/tests/native-watch.test.jsThe existing
native-watch.test.jsasserts only initial compilation, so the separate live-edit probe supplies the regression verification.Reproduce and inspect
results/*.logandresults/*.json.The first PR run had one false failure in the plain build/watch probe: duplicate compilations left a prior error in the accumulated output even after later cycles reported zero errors. The probe was corrected to evaluate individual completed compilation cycles, and all four PR scenarios passed in a fresh run (
pr64210-confirmed). The initial raw run is retained for transparency.TSRX tracked files, dependency pins, and lockfile were not changed. No GitHub comment was posted. Test fixture directories were removed and spawned watch processes stopped; builds, probe, and logs remain in this temporary directory. Results apply to this macOS x64 environment and the exact revisions above.
jakebailey commentedon Sep 22, 2026
Thanks. I'm scoping #64210 specifically down to the other issue, but I should be able to send a different Pr to fix this one.
leonidaz commentedon Sep 30, 2026
Confirmed fixed by #64210, thanks Jake Bailey (@jakebailey).
On macOS (x64), a plain
.tsproject withtsc --watch(no content mapper) now recompiles after an edit:7.1.0-dev.20260922.17.1.0-dev.20260923.17.1.0-dev.20260930.4It also recompiles with our content mapper on both fixed builds, for edits to the mapped file and to the
.tsimporter. Closing.jakebailey commentedon Sep 30, 2026
Oh, what? That PR was enough?
leonidaz commentedon Sep 30, 2026
I mean, we tried out the latest nightlies and saw both of your pr's merged and it's working now. 🤷♂️
feat(typescript-plugin): require TypeScript 7.1.0-dev.20260923.1, who…
Native TypeScript 7 support for .tsrx through a content mapper (#41) (#…