I'm having this issue constantly, specially with devcontainers or other virtual environments, where I suddenly have hundreds, if not thousands of intellisense errors all over my TS code while the app works just fine.
This is mostly due to VSCode not selecting the correct TS Version automatically. Even if you have "typescript.tsdk": "node_modules/typescript/lib"
in your .vscode/settings.json
it mostly fails.
To solve this:
- Open any typescript (
*.ts
) file. - Hit
F1
orCtrl + Shift + P
- Search for "TypeScript: Select TypeScript Version..." and hit enter
- Select "Use Workspace Version" (even if the version number is the same as VSCode's version)
- Reload VSCode (close it and reopen it) for it to take full effect and for it to reprocess all open tabs.
This is usually how I fix the issue.
Top comments (1)
Use Workspace Version doesn't even show as an option... StackOverflow threads aren't helping. I think the newest version of TS is broken with VS Code.