-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Persistent incorrect semantic diagnostic after large rebase or checkout: Module has no exported member #47466
Comments
Isn't this fixed by #47274? |
#47274 is not fixed. Besides, these may be separate issues, because the way that caches get invalidated for program structure is different than how source file info caches get updated. This is interesting... My repro steps: I have two branches, foo and bar, which include many file changes between them, including a file, "dependenecy.tsx"
I did not see any FileWatcher:: Closed log lines. |
I have a theory that the issue is this code, which does not properly handle if a file's inode changes: TypeScript/src/compiler/sys.ts Lines 1653 to 1659 in 1298f49
fs.watch() does not watch a "path", it watches an inode, and the inode for a path can change. The code above does not handle this because if it discovers the file still exists after a rename, it assumes the watch it still good, when there's a very good chance that it's not. It turns out this is really easy to reproduce with just vim. Repro steps:
When you issue a This will trigger the bug and it will manifest one of two ways. Case 2: FileWatcher will trigger but will not close, but after that there will be no more watch events if you do it again. I suspect git is sometimes (always?) performing some kind of operation like vim is with I confirmed that my git checkout repro is changing the inode with |
(If I am correct, then I am quite certain this issue is different than #47274) |
Coming here from #44066. If I add these VS Code settings the issue disappears for me, i.e. there are no stale errors when I switch branch (using my test case in #44066): "typescript.tsserver.watchOptions": {
"watchFile": "useFsEvents",
"watchDirectory": "useFsEvents"
}, Just mentioning it in case it's helpful information for debugging. |
This issue is for users of FsEvents, so your suggestion doesn't really apply here. But thanks for commenting! |
Bug Report
When using tsserver in VSCode, I sometimes see persistent false error reports from diagnostics after a large rebase or checkout of the form, "Module '{}' has no exported member '{}'." The file mentioned in the error is a file that was updated in the checkout or rebase. Opening the file in question in VSCode loads the file and resolves the incorrect semantic diagnostic. Alternatively, restarting TSServer resolves the incorrect diagnostic
🔎 Search Terms
module has no exported member watch
🕗 Version & Regression Information
This has been happening as long as we can remember
🙁 Actual behavior
persistent incorrect ssemantic diagnostics
🙂 Expected behavior
No errors after a reasonable period of time
The text was updated successfully, but these errors were encountered: