Skip to content

VSCode not respecting declaration map without absolute sourceRoot #62009

Open
@ishchhabra

Description

@ishchhabra

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

  • VS Code Version: 1.101.2
  • OS Version: MacOS 15.1.1

Steps to Reproduce:

  1. Clone https://github.com/ishchhabra/pnpm-workspace-example
  2. Open apps/web/src/app/page.tsx and CMD+Click on Link. It'll open the Link.d.ts file (from dist).

If I add
"sourceRoot": "/Volumes/Development/pnpm-workspace-example/packages/ui/src" to packages/ui/tsconfig.json, it takes me to the Link.tsx file in packages/ui/src/components, however, using "sourceRoot": "./src" takes user to the declaration file in dist/.

I am able to workaround by adding "@packages/ui": ["../../packages/ui/src"] in paths in the tsconfig for apps/web, however that is not ideal since that requires defining paths in every app that uses the package.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions