Skip to content

Strange vscode typescript intellisense bug. #61705

Closed as not planned
Closed as not planned
@semanticist21

Description

@semanticist21

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.100.1
  • OS Version: Mac OS Sequoia

Hi, I'm using an Nx monorepo in my project, and I'm struggling with strange TypeScript-related bugs. I think the issue might be related to my TypeScript configuration, but oddly enough, it only triggers when I install additional libraries.

[What I did]

Ran npx create-nx-workspace@latest nx-test2 --preset=next --pm=pnpm

Installed several libraries.

Once the number or size of installed libraries reaches a certain threshold, TypeScript IntelliSense breaks.

[What happens]

When I add multiple libraries, IntelliSense eventually malfunctions.

After breaking, IntelliSense can correctly find types in /node_modules/@types but fails to recognize .d.ts files bundled with other libraries.

For example, when I type useEffect, auto-import suggestions work fine(Installed with @types/react. However, typing dayjs, which has its own type definitions, does not trigger auto-import suggestions.

If I manually import these libraries, TypeScript does not report any errors.

I checked this issue on a teammate's computer, and the same behavior occurs.

[Reproduce] This issue is unusual, so I've prepared a sample project. For each case below, run pnpm i and then use the command palette to execute Restart TS Server.

Case 1: The query-string library is installed, causing IntelliSense to fail.

Typing dayjs will not show auto-import suggestions.

Case 1 Branch Link

Case 2 (Working): The query-string library is not installed, and IntelliSense works normally.

Typing dayjs correctly shows auto-import suggestions.

Case 2 Branch Link

(query-string lib is not the problem itself, it is just one of trigger library I found during work.)
I've set up many TypeScript projects before, but this particular issue has me puzzled. I'd greatly appreciate any insights or solutions—perhaps it's something simple I'm overlooking.

Image

Image

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions