microsoft / microsoft/TypeScript

project reference resolution fails when workspace is opened through a symlinked root path

Đang mở
#63,819 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

@andrewbranch đang làm issue này rồi.

Từ ngày 6/5/2026.

Needs Investigation
Ngôn ngữ chính
Go
Star
111k
Fork
14.3k
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
132

Mô tả

Summary

When a workspace is opened through a symlinked root path, tsgo language service can report TS2307 for packages that should resolve through project references.

In our case:

  • Opening the repo via /data00/home/my-username/my-project works
  • Opening the same repo via /home/my-username/my-project fails
  • /home/my-username is a symlink to /data00/home/my-username

The failing diagnostic is:

Cannot find module '@my-project/base' or its corresponding type declarations.ts(2307)

Environment

  • tsgo language service
  • Linux
  • Workspace root opened through a symlink
  • Example symlink:
/home/my-username -> /data00/home/my-username

Actual behavior

When opening a file through the symlinked workspace path, module resolution fails for a package that should resolve via project references.

Example:

  • Works: /data00/home/my-username/my-project/...
  • Fails: /home/my-username/my-project/...

Expected behavior

The same workspace should resolve project-reference-backed packages identically whether it is opened through:

  • the real path
  • a symlinked root path

Minimal reproduction

A minimal regression test was added that reproduces the issue with:

  • a workspace root exposed through a symlink
  • an app project
  • a referenced package project
  • a node_modules symlink from the app to the package
  • a package types entry pointing at a generated .d.ts output that does not exist on disk

Behavior before the fix:

  • opening through realpath resolves successfully
  • opening through workspace-root symlink fails with TS2307

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.