-
-
Notifications
You must be signed in to change notification settings - Fork 37.1k
Resolution Algorithm Specification fixing #49402
Copy link
Copy link
Closed
Labels
docIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
Description
Activity
Metadata
Metadata
Assignees
Labels
docIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
Affected URL(s)
https://nodejs.org/dist/latest-v20.x/docs/api/esm.html#resolution-algorithm-specification
Description of the problem
PACKAGE_RESOLVE function step 11.1 should contains:
Let packageURL be the URL resolution of "node_modules/" concatenated with packageName, relative to parentURL.
The original PACKAGE_EXPORTS_RESOLVE is wrong if subpath is "./xyz" and the keys of exports are not starting with "." (conditions) the step 4 is executed. The suggestion how PACKAGE_EXPORTS_RESOLVE should be implemented.
PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions)
1. Let mainExport be exports["."].
1. Let mainExport be exports.
1. Let resolved be the result of PACKAGE_TARGET_RESOLVE(packageURL, mainExport, null, false, conditions).
1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE(subpath, exports, packageURL, false, conditions).