Skip to content

loader: enforce path normalization before lookup - #63917

Merged
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
arcanis:mael/packate-maps-win32-normalization
Jul 26, 2026
Merged

loader: enforce path normalization before lookup#63917
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
arcanis:mael/packate-maps-win32-normalization

Conversation

@arcanis

@arcanis arcanis commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

It seems that calling createRequire(p) doesn't normalize p when it's an absolute path (see here). This causes package maps to fail on calls such as createRequire(process.cwd() + "/node_modules/foo/index.js") because the forward slashes will remain and mismatch with the internal folder -> package name map (whose keys are normalized).

A fix would be to normalize p within createRequire, but it felt reasonable to make a smaller change to the package map lookup method, since nothing else cared about that before.

@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 Jun 14, 2026
Signed-off-by: Maël Nison <nison.mael@gmail.com>
@arcanis
arcanis force-pushed the mael/packate-maps-win32-normalization branch from 25faa5c to 2811e40 Compare June 14, 2026 21:27
@arcanis

arcanis commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

None of the failed tests look relevant to this PR

@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Jun 19, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 19, 2026
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@trivikr trivikr added commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. commit-queue Add this label to land a pull request using GitHub Actions. labels Jul 26, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 26, 2026
@nodejs-github-bot
nodejs-github-bot merged commit c8da4ec into nodejs:main Jul 26, 2026
97 of 101 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in c8da4ec

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

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. 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.

6 participants