Skip to content

fix(cli): resolve tray runtime import to a file:// URL so --tray works on Windows - #11332

Merged
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.50from
pacocartones:fix/tray-runtime-windows-esm-import
Aug 24, 2026
Merged

diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.50from
pacocartones:fix/tray-runtime-windows-esm-import

Conversation

@pacocartones

Copy link
Copy Markdown
Contributor

loadSystray() in bin/cli/runtime/trayRuntime.ts passed the absolute path join(RUNTIME_DIR, "node_modules", SYSTRAY_PACKAGE) straight to dynamic import(). import() resolves its specifier as a URL: on Windows the leading drive letter (C:) is parsed as an unsupported URL scheme and the ESM loader rejects it, so omniroute server --tray never loads the tray. POSIX absolute paths double as valid URLs, so CI stayed green and #11238 missed this call site (its regression guard only scans bin/cli/**/*.mjs template-literal imports).

Fix: build the specifier through pathToFileURL(...).href via a small exported systrayModuleSpecifier() helper, and add a regression test asserting the specifier is a file:// URL.

Verified: node --test on the new test plus tray-systray-loader-4605, cli-tray-systray2, windows-esm-import-paths — all green. Same defect class as #11238/#11240.

…s on Windows

loadSystray() in bin/cli/runtime/trayRuntime.ts passed the absolute path join(RUNTIME_DIR, "node_modules", SYSTRAY_PACKAGE) straight to dynamic import(). import() resolves its specifier as a URL: on Windows the leading drive letter (e.g. C:) is parsed as an unsupported URL scheme and the ESM loader rejects it, so `omniroute server --tray` never loads the tray. POSIX paths double as valid URLs, so CI stayed green and diegosouzapw#11238 missed this call site (its regression guard only scans bin/cli/**/*.mjs template-literal imports).

Wrap the path in pathToFileURL().href via a small systrayModuleSpecifier() helper, and add a regression test asserting the specifier is a file:// URL.
@diegosouzapw
diegosouzapw merged commit 644dd32 into diegosouzapw:release/v3.8.50 Aug 24, 2026
14 of 16 checks passed
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…s on Windows (diegosouzapw#11332)

Merged via consolidated batch validation. Fixes omniroute server --tray on Windows: absolute paths passed to dynamic import() are parsed as URLs, and a Windows drive letter (C:) isn't a supported URL scheme. Resolves via pathToFileURL. Own regression test passes.
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.

2 participants