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
Typescript build in watch mode does not compile newly created files or renamed files #37514
Sheetal Nandi (@sheetalkamat)Ryan Cavanaugh (@RyanCavanaugh)
This issue has been with us for at least 2 years; we're waiting so much until it's resolved, but it doesn't hapen. I understand that it may be super-hard to repro in a sandbox, but still, attaching a screencast showing the effect of this bug hoping that it would help to hint, what's going on.
Reproducible in BOTH VSCode editor (!!!) and in tsc --watch. I.e. it's not an artifact of our build system (which includes many components), it affects vanilla VSCode's TS server process running in noEmit mode too.
Below is one screencast split into 3 videos (one after another).
Configuration:
slapdash-server-ingestion monorepo project is compiled with a separate tsc --watch process with incremental=true
slapdash-server monorepo project (depends on the previous) is compiled with tsc --watch with emitDeclarationOnly=true and incremental=true
Basically, on the videos, the files appeared in node_modules/slapdash-server-ingestion/dist/.../ are not picked up by the watching tsc in slapdash-server (node_modules/slapdash-server-ingestion is a lerna-symlink to packages/slapdash-server-ingestion).
What I do there (in time order):
I have several tsc --watch processes running, and then I check out a version from Git which has new TS files (dist/.../FactAllAclsOfAssetAre.ts) appeared in slapdash-server-ingestion monorepo project (compiled with a separate tsc --watch process).
tsc --watch of slapdash-server-ingestion compiles the new files (FactAllAclsOfAssetAre.ts) into dist/ folder. But then, from within slapdash-server monorepo project (from within slapdash-server/.../FactAllAclsOfAssetAre.test.ts on the 1st video), the compilation result (dist/.../FactAllAclsOfAssetAre.d.ts) is not visible: e.g. VSCode red-underlines the file as missing (although it's there), and tsc --watch for slapdash-server doesn't see the file too.
Now an interesting part
Re-saving FactAllAclsOfAssetAre.test.ts (without modifying it) does NOT help. See the bottom of the 1st video which records the keystrokes. It doesn't help in both VSCode and in tsc --watch which compiles FactAllAclsOfAssetAre.test.ts.
What's interesting is that, if I do a dummy change in import directive in FactAllAclsOfAssetAre.test.ts and then revert it, all without saving (video 2), it helps VSCode to find the file (but it obviously doesn't let tsc --watch unstuck). It looks like there is some cache in the watching process which is not refreshed even on a file change, and the only time when it's refreshed is when that particular import statement changes.
Only when I do a dummy change in FactAllAclsOfAssetAre.test.ts in that import statement AND SAVE IT, then revert the change and save again, it unsticks tsc --watchfor that file only.
I have to repeat the same procedure (open a stuck file, apply a dummy change in import statement (not in any other parts of the code! exactly in that import statement!) to fully unstuck all of the files eventually (video 3).
Same issue, on webstorm. Changing tsconfig.json include/exclude patterns isn't helping. Editing and reverting the import statement is the only workaround so far, but not a fix. Can this be looked at please?
Hey folks, sorry we haven't been able to root-cause this with the information available. The only way we're going to be able to make progress here is with a repro we can run locally - for something like this, that generally means a cloneable repro. "Me too" or prose descriptions of what you're encountering are unfortunately not useful at all in helping us find a fix. Please log a new issue with a repro we can run locally if you're able to. Thanks!
Activity
sheetalkamat commentedon Mar 23, 2020
This does not repro as you mentioned. We would need detail steps to repro the issue along with sample code to see if something is wrong.
dko-slapdash commentedon Oct 31, 2022
Sheetal Nandi (@sheetalkamat) Ryan Cavanaugh (@RyanCavanaugh)
This issue has been with us for at least 2 years; we're waiting so much until it's resolved, but it doesn't hapen. I understand that it may be super-hard to repro in a sandbox, but still, attaching a screencast showing the effect of this bug hoping that it would help to hint, what's going on.
Reproducible in BOTH VSCode editor (!!!) and in
tsc --watch. I.e. it's not an artifact of our build system (which includes many components), it affects vanilla VSCode's TS server process running in noEmit mode too.Below is one screencast split into 3 videos (one after another).
Configuration:
tsc --watchprocess with incremental=truetsc --watchwith emitDeclarationOnly=true and incremental=trueBasically, on the videos, the files appeared in node_modules/slapdash-server-ingestion/dist/.../ are not picked up by the watching tsc in slapdash-server (node_modules/slapdash-server-ingestion is a lerna-symlink to packages/slapdash-server-ingestion).
What I do there (in time order):
tsc --watchprocesses running, and then I check out a version from Git which has new TS files (dist/.../FactAllAclsOfAssetAre.ts) appeared in slapdash-server-ingestion monorepo project (compiled with a separatetsc --watchprocess).tsc --watchof slapdash-server-ingestion compiles the new files (FactAllAclsOfAssetAre.ts) into dist/ folder. But then, from within slapdash-server monorepo project (from within slapdash-server/.../FactAllAclsOfAssetAre.test.ts on the 1st video), the compilation result (dist/.../FactAllAclsOfAssetAre.d.ts) is not visible: e.g. VSCode red-underlines the file as missing (although it's there), andtsc --watchfor slapdash-server doesn't see the file too.Now an interesting part
tsc --watchwhich compiles FactAllAclsOfAssetAre.test.ts.importdirective in FactAllAclsOfAssetAre.test.ts and then revert it, all without saving (video 2), it helps VSCode to find the file (but it obviously doesn't lettsc --watchunstuck). It looks like there is some cache in the watching process which is not refreshed even on a file change, and the only time when it's refreshed is when that particularimportstatement changes.importstatement AND SAVE IT, then revert the change and save again, it unstickstsc --watchfor that file only.importstatement (not in any other parts of the code! exactly in thatimportstatement!) to fully unstuck all of the files eventually (video 3).CleanShot.2022-10-30.at.17.43.26.mp4
CleanShot.2022-10-30.at.17.44.28.mp4
CleanShot.2022-10-30.at.17.55.04.mp4
mayzenator commentedon Feb 9, 2023
hi! any updates on this thread? seeing the same issue
adriana47 commentedon Apr 7, 2023
Same issue, on webstorm. Changing tsconfig.json include/exclude patterns isn't helping. Editing and reverting the import statement is the only workaround so far, but not a fix. Can this be looked at please?
aakash14goplani commentedon Nov 26, 2023
Facing same issue with SvelteKit + Turbo Monorepo setup.
There are two ways to reproduce this:
Run the localhost now, it will forever load...
RyanCavanaugh commentedon Aug 8, 2024
Hey folks, sorry we haven't been able to root-cause this with the information available. The only way we're going to be able to make progress here is with a repro we can run locally - for something like this, that generally means a cloneable repro. "Me too" or prose descriptions of what you're encountering are unfortunately not useful at all in helping us find a fix. Please log a new issue with a repro we can run locally if you're able to. Thanks!