Skip to content

Conversation

devongovett
Copy link
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.

@devongovett devongovett merged commit e2c2a29 into v2 Mar 19, 2025
17 checks passed
@devongovett devongovett deleted the fix-self-resolution branch March 19, 2025 06:00
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