DEV Community

Daniel
Daniel

Posted on

Fixing Most TypeScript Intellisense issues in VS Code

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:

  1. Open any typescript (*.ts) file.
  2. Hit F1 or Ctrl + Shift + P
  3. Search for "TypeScript: Select TypeScript Version..." and hit enter
  4. Select "Use Workspace Version" (even if the version number is the same as VSCode's version)
  5. 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 (0)