fix(javascript): resolve relative ESM backslash paths (#4323)

Normalize raw URL separators after admitting an original relative ESM
request, before artifact path validation and root confinement. Preserve
the authored declaration and the existing encoded-separator checks.

Retain Node-backed static and dynamic loader controls and compare the
application graph with the historical importer already present on main.
Narrow PR #4323 to this remaining case after the upstream #4269 fix.

Signed-off-by: Jiakai Xu <jiakaiPeanut@gmail.com>
This commit is contained in:
Jiakai Xu authored and GitHub committed 2026-10-29 02:03:00 +08:00
1 parent f19436c156
commit 19032204aa
3 files changed
+75 -11

No files matched your search

@@ -636,7 +636,11 @@ const contextualCandidate = (
}
const hasUrlPathSemantics =
context === "module-specifier" && input.moduleKind === "import";
if (hasUrlPathSemantics) declared = htmlUrlText(declared);
if (hasUrlPathSemantics) {
declared = htmlUrlText(declared);
if (isRelativeJavaScriptModuleSpecifier(input.declaredPath))
declared = declared.replaceAll("\\", "/");
}
const rejected = rejectDeclaration(
declared,
declaresLiteralPercent(input) || hasUrlPathSemantics,