microsoft / microsoft/TypeScript

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

Ouverte
#63,819 1 commentaire 0 réactions 1 personne assignée Voir sur GitHub

@andrewbranch y travaille déjà.

Depuis le 6/5/2026.

Needs Investigation
Langage dominant
Go
Étoiles
111k
Forks
14.3k
Merge moyen
2 j 4 h
PR mergées (30 j)
132

Description

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

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.