You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tsc --watch doesn't pick up changes when the project is in a shallow folder like /app #64425
tsc --watch not rebuilding, watch doesn't detect changes, docker, WORKDIR /app, no watchable ancestor
🕗 Version & Regression Information
This changed between versions @typescript/native-preview@7.0.0-dev.20260612.1 and 7.0.0-dev.20260613.1
I think it came in with microsoft/typescript-go#4026. It still happens on 7.0.2 and on today's nightly (7.1.0-dev.20260924.1). 6.0.3 works fine.
⏯ Playground Link
No response
💻 Code
mkdir /app &&cd /app
echo'{"compilerOptions":{"outDir":"out"},"include":["*.ts"]}'> tsconfig.json
echo'export const x = "AAA";'> a.ts
TS_WATCH_DEBUG=1 npx tsc --watch
# now edit a.ts
🙁 Actual behavior
The first build works, but after that nothing happens when I edit a.ts. No rebuild, no error. With TS_WATCH_DEBUG=1 it prints:
[watch] no watchable ancestor for /app
Same with tsc -b --watch. I hit this in Docker, where /app is a pretty common WORKDIR.
It's not only /app. In /srv/app nothing rebuilds either. In /usr/src/app or ~/project, files under src/ still rebuild, but files right in the project folder don't. That made it really confusing to track down.
🙂 Expected behavior
Edits get picked up, like in 6.0.3, or like in 7 when the project sits a bit deeper (/usr/src/app/server works fine).
Additional information about the issue
From what I can tell, CanWatchDirectory wants at least 5 path components, and it runs on every directory the watcher wants, including the project's own folders. In 6.0 the same check was only used for lookup locations (failed module lookups, package.json, @types), never for the project's files.
changed the title [-]`tsc --watch` never rebuilds when the project is close to the filesystem root (e.g. `/app` in Docker)[/-][+]`tsc --watch` doesn't pick up changes when the project is in a shallow folder like `/app`[/+]on Sep 24, 2026
Activity
[-]`tsc --watch` never rebuilds when the project is close to the filesystem root (e.g. `/app` in Docker)[/-][+]`tsc --watch` doesn't pick up changes when the project is in a shallow folder like `/app`[/+]