Repository navigation
Stale errors for a few minutes after switching branches聽#44066
Description
Activity
- addedNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
on May 13, 2021 - addedRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone
on Aug 30, 2021 Oliver Joseph Ash (@OliverJAsh) The branch is no longer available. Are you still seeing the issue. If yes can you please provide the steps to repro
Thanks- removedNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.RescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone
on May 3, 2022 5 remaining items
- addedNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.and removedNeeds More InfoThe issue still hasn't been fully clarifiedThe issue still hasn't been fully clarified
on May 4, 2022 Oliver Joseph Ash (@OliverJAsh) thank you for the repro.
While investigating this the root cause of this is that we poll 32 files at a time every 2 seconds. Since your project has 2000+ files being watched it takes a while for it to show up. At this point this looks working as intended.
- addedWorking as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bugand removedNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
on May 4, 2022 OliverJAsh commented
on May 4, 2022 ContributorAuthorMore actionsIs there anything that could be done to improve the user experience? It seems quite extreme to wait this long for TS to fully update. To workaround this I have to restart the TS server very often.
Note that if I add these VS Code settings the issue disappears, i.e. there are no stale errors when I switch branch:
"typescript.tsserver.watchOptions": { "watchFile": "useFsEvents", "watchDirectory": "useFsEvents" },
Perhaps this should be the default?
I am trying to fix some of the issues with using file system watching since they are not reliable. After fix for #47466 , we could consider that but after we have tried it out. Eg. linux has some limit on number of file system watchers it can create.. Then there is non reliability because of watching inode.. though fix for #47466 will make it better but we will have to see how the experience is with that one.
Reacted by Oliver Joseph AshOliverJAsh commented
on May 5, 2022 ContributorAuthorMore actionsIn that case should we keep this issue open to track the user experience issue?
typescript-bot commented
on May 7, 2022 ContributorMore actionsThis issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes.
OliverJAsh commented
on May 25, 2022 ContributorAuthorMore actionsI understand this is working as intended but I think there is still a usability issue here. Can we re-open this to track that?
OliverJAsh commented
on Sep 9, 2022 ContributorAuthorMore actionsSheetal Nandi (@sheetalkamat) I just tested this again using TS 4.8 which includes #48997, the fix for #47466 which is mentioned above. Unfortunately the issue persists鈥攊t still takes 2 minutes for the stale errors to disappear. Do you think we could re-open this issue and discuss ways to improve the user experience?
As I mentioned above, if I add these VS Code settings the issue disappears, i.e. there are no stale errors when I switch branch. Do you think we could consider making these settings the default now that #47466 has been addresssed?
"typescript.tsserver.watchOptions": { "watchFile": "useFsEvents", "watchDirectory": "useFsEvents" },
Let me know if you need an updated repro that uses TS 4.8.
4.8 fix was more towards linux which was one of the blocker to make
useFsEventsdefault.useFsEventsis default now with #50366 and is in nightly.
Daniel Rosenwasser (@DanielRosenwasser) is looking to see if we could get this as experiment in vscode for 4.8 users but it may take some time to get everything together or not work out at all. Mean time nightly will give you that experience.Reacted by Oliver Joseph Ash- locked as resolved and limited conversation to collaborators
on Oct 21, 2025
Bug Report
馃攷 Search Terms
performance vs code stale error switch branches git
馃晽 Version & Regression Information
馃捇 Code
Video demonstration: https://www.loom.com/share/b8accd596ea74f16ae41f524e6e1497f
TS server log: tsserver.log
typescript-stale-errors-a. This is a private repository but I believe some members of the TS team already have access from debugging previous issues. If you don't have access, please send me your email address so I can provide access (TS team members only).yarnapp/routes/Users/components/UserStatsSubRoute/UserStatsSubRoute.tsxgit checkout typescript-stale-errors-b馃檨 Actual behavior
Stale errors in the open file for about 2 minutes.
馃檪 Expected behavior
Related: microsoft/vscode#122928