Context
@GautamSahu028 ran the unit suite on a clean Windows 11 clone at 203de91bc2, from Git Bash (#18985 issuecomment-5830935499, the full list-reporter log attached there). The result was 50 failed, 4507 passed. The failures come from about six separate causes. This ticket covers one of them: 9 tests in 2 spec files that turn between file URLs and filesystem paths the POSIX-only way. Both cases are test-side; no engine source is involved.
handoff: @GautamSahu028. They asked for this one on #19200, and it gets assigned to them as soon as they comment here, because GitHub assigns an outside contributor only after they've taken part in the issue.
The Problem
1. test/playwright/unit/buildScripts/distAppAssets.spec.mjs:25: 4 failures
repoRoot = path.resolve(path.dirname(new URL(import.meta.url).pathname), '../../../..')
On Windows, URL.pathname is /G:/Github/neo/test/…. path.resolve reads the leading / as the current drive's root, so repoRoot becomes G:\G:\Github\neo. Observed:
ENOENT: no such file or directory, open 'G:\G:\Github\neo\buildScripts\webpack\development\webpack.config.appworker.mjs'
2. test/playwright/unit/main/MainWorkspaceAddon.spec.mjs: 5 failures
The spec runs inline node --input-type=module -e scripts whose import specifiers interpolate a filesystem path: lines 28–30 and 60 use ${engine}, and lines 88–90 and 119–120 use ${REPO_ROOT}. On Windows the specifier is G:\Github\neo/src/Neo.mjs, which Node reads as a URL with the scheme g::
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs.
The Architectural Reality
node:url has the portable conversions: fileURLToPath (URL → path) and pathToFileURL (path → URL, whose .href is a valid import specifier on every platform).
MainWorkspaceAddon.spec.mjs:10 already uses fileURLToPath for its own __dirname, so only the specifiers it hands to the child process are wrong.
resolveAddon's engine may be a symlink (the spec creates one at line 177 and runs with --preserve-symlinks). pathToFileURL does not resolve links, so the preserved path stays intact.
The Fix
distAppAssets.spec.mjs:25: path.dirname(fileURLToPath(import.meta.url)) in place of new URL(…).pathname.
MainWorkspaceAddon.spec.mjs: build each interpolated specifier as pathToFileURL(path.join(root, 'src/Neo.mjs')).href (and the same for the other paths) before it goes into the script text.
Acceptance Criteria
Out of Scope
- The other Windows causes in the same log: path-separator assertions, the doc pipeline's glob patterns, shell and spawn quoting, a tab character in a test filename, and one portal failure. They're tracked separately.
MainWorkspaceAddon.spec.mjs:177's 'dir' symlink needs Developer Mode on Windows ('junction' would not). It is not failing in this log, so it stays out unless it fails for you.
Related
#18985 (the contributor door) · #19200 (where the Windows run started) · #16393 (the earlier native-Windows prepare fix)
Live latest-open sweep: checked the latest 20 open issues at 2026-09-25T10:56:02Z, plus windows in:title across all states; no equivalent.
A2A in-flight sweep: the latest 15 messages at 10:56Z; no claim on these specs.
MC sweep: "Windows unit specs fail: doubled drive letter … ERR_UNSUPPORTED_ESM_URL_SCHEME", 5 results, no prior decision.
Own-assignment sweep: 6 open; #18985 is the parent, and none overlap.
Origin Session ID: 0f80515e-7682-4313-8101-b926da48c55c
Context
@GautamSahu028 ran the unit suite on a clean Windows 11 clone at
203de91bc2, from Git Bash (#18985 issuecomment-5830935499, the full list-reporter log attached there). The result was 50 failed, 4507 passed. The failures come from about six separate causes. This ticket covers one of them: 9 tests in 2 spec files that turn between file URLs and filesystem paths the POSIX-only way. Both cases are test-side; no engine source is involved.handoff: @GautamSahu028. They asked for this one on #19200, and it gets assigned to them as soon as they comment here, because GitHub assigns an outside contributor only after they've taken part in the issue.
The Problem
1.
test/playwright/unit/buildScripts/distAppAssets.spec.mjs:25: 4 failuresrepoRoot = path.resolve(path.dirname(new URL(import.meta.url).pathname), '../../../..')On Windows,
URL.pathnameis/G:/Github/neo/test/….path.resolvereads the leading/as the current drive's root, sorepoRootbecomesG:\G:\Github\neo. Observed:2.
test/playwright/unit/main/MainWorkspaceAddon.spec.mjs: 5 failuresThe spec runs inline
node --input-type=module -escripts whose import specifiers interpolate a filesystem path: lines 28–30 and 60 use${engine}, and lines 88–90 and 119–120 use${REPO_ROOT}. On Windows the specifier isG:\Github\neo/src/Neo.mjs, which Node reads as a URL with the schemeg::The Architectural Reality
node:urlhas the portable conversions:fileURLToPath(URL → path) andpathToFileURL(path → URL, whose.hrefis a valid import specifier on every platform).MainWorkspaceAddon.spec.mjs:10already usesfileURLToPathfor its own__dirname, so only the specifiers it hands to the child process are wrong.resolveAddon'senginemay be a symlink (the spec creates one at line 177 and runs with--preserve-symlinks).pathToFileURLdoes not resolve links, so the preserved path stays intact.The Fix
distAppAssets.spec.mjs:25:path.dirname(fileURLToPath(import.meta.url))in place ofnew URL(…).pathname.MainWorkspaceAddon.spec.mjs: build each interpolated specifier aspathToFileURL(path.join(root, 'src/Neo.mjs')).href(and the same for the other paths) before it goes into the script text.Acceptance Criteria
distAppAssets.spec.mjsandMainWorkspaceAddon.spec.mjspass on Windows, shown by a run on Windows posted in the PR.Out of Scope
MainWorkspaceAddon.spec.mjs:177's'dir'symlink needs Developer Mode on Windows ('junction'would not). It is not failing in this log, so it stays out unless it fails for you.Related
#18985 (the contributor door) · #19200 (where the Windows run started) · #16393 (the earlier native-Windows
preparefix)Live latest-open sweep: checked the latest 20 open issues at 2026-09-25T10:56:02Z, plus
windows in:titleacross all states; no equivalent. A2A in-flight sweep: the latest 15 messages at 10:56Z; no claim on these specs. MC sweep: "Windows unit specs fail: doubled drive letter … ERR_UNSUPPORTED_ESM_URL_SCHEME", 5 results, no prior decision. Own-assignment sweep: 6 open; #18985 is the parent, and none overlap.Origin Session ID: 0f80515e-7682-4313-8101-b926da48c55c