Skip to content

module: normalize package map paths - #66054

Open
Dansatch wants to merge 1 commit into
nodejs:mainfrom
Dansatch:fix-package-map-directory-urls
Open

Dansatch wants to merge 1 commit into
nodejs:mainfrom
Dansatch:fix-package-map-directory-urls

Conversation

@Dansatch

@Dansatch Dansatch commented Sep 16, 2026

Copy link
Copy Markdown

Fixes #66043

Package-map URLs ending with a slash, including ".." and "./", are stored differently from the paths used during lookup. This causes valid dependencies to fail with ERR_PACKAGE_MAP_EXTERNAL_FILE.

This change normalizes package paths when the map is loaded. Tests cover CommonJS, ESM, parent-directory URLs, trailing slashes, and duplicate paths.

The bug was reproduced on Node.js v26.8.2.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/loaders

@nodejs-github-bot nodejs-github-bot added module Issues and PRs related to the module subsystem. needs-ci PRs that need a full CI run. labels Sep 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Welcome to Node.js, and thank you for your first contribution!

Before review, please take a moment to read:

Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal.

Signed-off-by: dansatch <dansatch98@gmail.com>
@Dansatch
Dansatch force-pushed the fix-package-map-directory-urls branch from e21d359 to 40dc850 Compare September 16, 2026 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module Issues and PRs related to the module subsystem. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Package map entry whose url resolves to a directory-form URL never matches its files

2 participants