Skip to content

fix resolving package self references#10114

Merged
devongovett merged 1 commit into
v2from
fix-self-resolution
Mar 19, 2025
Merged

fix resolving package self references#10114
devongovett merged 1 commit into
v2from
fix-self-resolution

Conversation

@devongovett

Copy link
Copy Markdown
Member

The Node ESM resolution algorithm has a special case for package self references, i.e. packages importing themselves. Usually, these can be resolved as normal, by resolving from node_modules/foo/bar.js up to node_modules/foo/package.json. However, if the module is not actually inside a node_modules directory this doesn't work. In particular, Pnpm uses a web of symlinks into a .pnpm directory, and does not symlink the module itself into its own local node_modules folder. Therefore, we need to implement this special case for self references.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants