Skip to content

Commit 82d4ae4

Browse files
committed
fix: use pathToFileURL for cross-platform sidecar URL
Address Cursor Bugbot review: string interpolation `file://${path}` produces invalid URLs on Windows where join() uses backslashes. Use pathToFileURL() which correctly normalizes to file:///C:/... URLs.
1 parent 9da45e2 commit 82d4ae4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

test/e2e/bundle.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { spawn } from "node:child_process";
99
import { existsSync, rmSync } from "node:fs";
1010
import { readFile } from "node:fs/promises";
1111
import { join } from "node:path";
12+
import { pathToFileURL } from "node:url";
1213
import { afterAll, beforeAll, describe, expect, test } from "vitest";
1314

1415
function noop(): void {
@@ -221,7 +222,7 @@ describe("npm bundle", () => {
221222
const { stdout, stderr, exitCode } = await spawnCollect("node", [
222223
"--input-type=module",
223224
"-e",
224-
`import { mountApp } from ${JSON.stringify(`file://${INK_APP_PATH}`)};\n` +
225+
`import { mountApp } from ${JSON.stringify(pathToFileURL(INK_APP_PATH).href)};\n` +
225226
'if (typeof mountApp !== "function") {\n' +
226227
' process.stderr.write("mountApp is " + typeof mountApp + ", expected function");\n' +
227228
" process.exit(1);\n" +

0 commit comments

Comments
 (0)