fix(runner): import resolved packages via file:// URLs on win32 - #1429
Merged
Conversation
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
Chase J (chajac)
marked this pull request as ready for review
July 31, 2026 18:59
Simon Ingeson (smonn)
approved these changes
Jul 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes WIZ-11313.
Problem
qawolf flows runon Windows fails with:Could not load @qawolf/testkit ... 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. Received protocol 'c:'The npm-installed CLI runs under Node, and
import()treats its argument as a URL, not a filesystem path. POSIX paths happen to parse as URL paths, but a Windows path (C:\...) parses as URL protocolc:, which Node's ESM loader rejects. Four call sites passed rawresolveFromEnvDir()/join()paths toimport(): the testkit loader (both imports — the reported failure), the Playwright loader, and the emails loader.Fix
New
src/shell/importFromPath.tsconverts an absolute path to afile://URL viapathToFileURLbefore importing; all four sites now use it. Same-module-instance semantics are unchanged on POSIX (Node keys its ESM cache by the resolvedfile://URL, which is identical for both forms), so the shared-AsyncLocalStorage invariant holds.Regression guard
The
windows-smokeCI job gains a smoke that bundles the realsrc/shell/testkit.tsand drivesconfigureTestkitunder Node on win32 against a fixture@qawolf/testkit— red on the previous code (Received protocol 'c:'), green with the fix. Only Node-on-win32 rejects raw absolute-path specifiers, so only that job can catch a regression here.Testing
import("C:\\temp\\x.js")throwsERR_UNSUPPORTED_ESM_URL_SCHEMEon any platform)