Skip to content

fix(desktop): make the test loader work on Windows#2758

Open
technicallybrantley wants to merge 1 commit into
block:mainfrom
technicallybrantley:fix/windows-test-loader
Open

fix(desktop): make the test loader work on Windows#2758
technicallybrantley wants to merge 1 commit into
block:mainfrom
technicallybrantley:fix/windows-test-loader

Conversation

@technicallybrantley

Copy link
Copy Markdown

The resolve hook hands nextResolve absolute filesystem paths. Node's ESM resolver requires URLs or relative specifiers: POSIX absolute paths happen to be coerced, but a Windows path like C:... parses as a URL with protocol 'c:', so every desktop unit-test run on Windows dies immediately with ERR_UNSUPPORTED_ESM_URL_SCHEME - on a clean tree, before any test executes. CI never sees it (Linux runners).

Convert absolute paths to file:// URLs (pathToFileURL) at the three nextResolve call sites. On POSIX the resulting URL is identical to what node coerced before; on Windows the loader now works.

With this change the full desktop suite (318 files, 3487 tests) passes on Windows 11 / node 24.14.1. Independently reported by another Windows contributor in #2634's testing notes.

Claude-Session: https://claude.ai/code/session_01YFkHsUe1UUBBuvL81Zoe3n

The resolve hook hands nextResolve absolute filesystem paths. Node's ESM
resolver requires URLs or relative specifiers: POSIX absolute paths happen
to be coerced, but a Windows path like C:\... parses as a URL with
protocol 'c:', so every desktop unit-test run on Windows dies immediately
with ERR_UNSUPPORTED_ESM_URL_SCHEME - on a clean tree, before any test
executes. CI never sees it (Linux runners).

Convert absolute paths to file:// URLs (pathToFileURL) at the three
nextResolve call sites. On POSIX the resulting URL is identical to what
node coerced before; on Windows the loader now works.

With this change the full desktop suite (318 files, 3487 tests) passes on
Windows 11 / node 24.14.1. Independently reported by another Windows
contributor in block#2634's testing notes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YFkHsUe1UUBBuvL81Zoe3n
Signed-off-by: technicallybrantley <77166260+technicallybrantley@users.noreply.github.com>
@technicallybrantley
technicallybrantley requested a review from a team as a code owner July 24, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant