LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-ada
createdAtSep 25, 2026, 12:56 PM
updatedAtNov 6, 2026, 10:14 PM
githubUrlhttps://github.com/neomjs/neo/issues/19209
authorneo-opus-ada
commentsCount5
parentIssue18985
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 6, 2026, 10:14 PM

Two unit specs convert file URLs and paths wrongly on Windows

Closed v13.4.0/archive-v13-4-0-chunk-3 bughelp wantedcontributor-experienceaitesting
neo-opus-ada
neo-opus-ada commented on Sep 25, 2026, 12:56 PM

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

  • The 9 tests in distAppAssets.spec.mjs and MainWorkspaceAddon.spec.mjs convert portably: fileURLToPath for the spec's own directory, and pathToFileURL(…).href for every specifier the child process imports.
  • Both files still pass in CI (Linux).
  • No other file changes.

Post-Merge Validation

  • A run of the two specs on Windows passes all 9 tests. (Moved here from the ACs on 2026-11-06: the PR is written on macOS, which cannot produce the run; the original reporter is invited to post it.)

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

GautamSahu028
GautamSahu028 Sep 25, 2026, 1:01 PM

Hi @neo-opus-ada, thanks for filing this. I'd like to take it, please assign it to me.

Plan, following the ticket:

  • distAppAssets.spec.mjs:25: path.dirname(fileURLToPath(import.meta.url)) in place of new URL(…).pathname.
  • MainWorkspaceAddon.spec.mjs: build each interpolated import specifier with pathToFileURL(…).href, for both ${engine} and ${REPO_ROOT}.

I'll post the failing Windows output before the fix and the passing run after it in the PR, and change only these two files.

  • 2026-09-25T11:02:26Z @neo-opus-ada assigned to @GautamSahu028

@neo-opus-ada - 2026-09-25T11:02:32Z

@GautamSahu028, it's yours. Your plan matches the ticket. The MainWorkspaceAddon specifiers also appear inside the two dynamic await import(…) calls at lines 60 and 119–120, so convert those too. When you push, CI will wait for a maintainer to approve it, and I'll approve it straight away. ⚖️ Ada (a maintainer on this repo)

  • 2026-09-30T13:36:52Z @neo-fable-clio cross-referenced by #19330
  • 2026-09-30T14:16:00Z @neo-fable-clio cross-referenced by #19332
  • 2026-10-01T09:08:00Z @neo-opus-grace cross-referenced by PR #19342
  • 2026-10-12T10:09:43Z @neo-opus-ada cross-referenced by #19642
  • 2026-10-22T15:07:15Z @neo-opus-ada cross-referenced by PR #20007
  • 2026-11-05T10:20:03Z @neo-opus-grace cross-referenced by #15000

@neo-opus-ada - 2026-11-05T10:41:35Z

Premise read by its author, 2026-11-05 (backlog sweep #15000), at dev 6ddbed1bd5. Both defects are still there. distAppAssets.spec.mjs still resolves its root from new URL(import.meta.url).pathname, and MainWorkspaceAddon.spec.mjs still builds its dynamic import() specifiers from file paths, at lines 60 and 119–120.

Verdict: holds, as a defect. @GautamSahu028, it's still yours. If you've moved on, a one-line reply here frees it for someone else.

⚖️ Ada · @neo-opus-ada · Claude Opus 5.5 · Claude Code

@neo-opus-ada - 2026-11-06T20:54:32Z

Picking up per 7-day rule; previous assignee @GautamSahu028; last qualifying activity 2026-09-25T11:02:26Z (the assignment, following your claim the same minute).

Thank you for the Windows run that found these. Both defects are still on dev 5f57baeadf, and the 13.4 cut wants the backlog down this weekend, so I'm writing the two-file fix now. You still have the one thing my macOS seat can't produce: AC-1's run on Windows. I'm moving it to Post-Merge Validation. If you can run the two specs on your Windows clone against the PR branch, please post the log on the PR. That would close it out before the merge.

⚖️ Ada · @neo-opus-ada · Claude Opus 5.5 · Claude Code

  • 2026-11-06T20:54:33Z @neo-opus-ada assigned to @neo-opus-ada
  • 2026-11-06T20:54:34Z @neo-opus-ada unassigned from @GautamSahu028

@neo-opus-ada - 2026-11-06T20:54:35Z

[lane-override] reassignment audit-trail (#11537 §AC8)

Previous assignees: @GautamSahu028 New assignees: neo-opus-ada Reason: 7-day rule: GautamSahu028 assigned 2026-09-25T11:02:26Z with no activity since; attribution comment posted on #19209

Audit-trail per AGENTS.md §6.5 — acknowledgedReassign reason persistence. Graph-ingested via Retrospective daemon comment-scan path.

  • 2026-11-06T20:56:44Z @neo-opus-ada cross-referenced by PR #20485
tobiu referenced in commit d7e91ec - "test(unit): convert file URLs and paths portably in two specs (#19209) (#20485) on Nov 6, 2026, 10:14 PM
tobiu closed this issue on Nov 6, 2026, 10:14 PM