Since 7.0.0-dev.20260617.2, tsgo --watch fails to start its file watcher on projects with many watched directories (large/symlinked node_modules).
It prints the compile banner and then:
Starting compilation in watch mode...
failed to watch directory <abs path>/node_modules/.bun/<pkg>: error starting FSEvents stream
and never reaches Found N errors. Watching for file changes.
The one-shot compile (tsgo --noEmit) on the same project succeeds in < 1s, so only watch mode is affected.
I tried to exclude, but the native port seems to ignore watchOptions, so I can't exclude folders.
Steps to reproduce:
macOS 15.7.7 on M1 Max, Bun monorepo. The Bun .bun layout reproduces it immediately because each dependency is its own directory, but any tree large enough to hit the macOS FSEvents stream limit should reproduce.
- In a project with a large
node_modules (Bun .bun layout works well),
tsgo -p tsconfig.json --watch --noEmit --pretty false
- Observe error starting FSEvents stream, no compile cycle.
Best guess on the cause:
Last good 7.0.0-dev.20260616.1 (462a1a4), first bad 7.0.0-dev.20260617.2 (2fb5d4c). The only watcher-related change in that range is #4326 "Rebuilt build mode around fswatch package", building on the fswatch rewrite from #3980 / #4026. The new fswatch appears to fail to open an FSEvents stream once the watched-directory count is large.
Since
7.0.0-dev.20260617.2,tsgo --watchfails to start its file watcher on projects with many watched directories (large/symlinked node_modules).It prints the compile banner and then:
and never reaches Found N errors. Watching for file changes.
The one-shot compile (tsgo --noEmit) on the same project succeeds in < 1s, so only watch mode is affected.
I tried to exclude, but the native port seems to ignore watchOptions, so I can't exclude folders.
Steps to reproduce:
macOS 15.7.7 on M1 Max, Bun monorepo. The Bun .bun layout reproduces it immediately because each dependency is its own directory, but any tree large enough to hit the macOS FSEvents stream limit should reproduce.
node_modules(Bun .bun layout works well),tsgo -p tsconfig.json --watch --noEmit --pretty falseBest guess on the cause:
Last good
7.0.0-dev.20260616.1(462a1a4), first bad7.0.0-dev.20260617.2(2fb5d4c). The only watcher-related change in that range is #4326 "Rebuilt build mode around fswatch package", building on the fswatch rewrite from #3980 / #4026. The new fswatch appears to fail to open an FSEvents stream once the watched-directory count is large.