History

Fix path helper shadowing Node's path module in dev-electron script

The helper function `f` declared a parameter named `path` which shadowed the intended use of Node's `path.join()`. Since strings don't have a `.join` method, this caused a runtime TypeError before Electron could start.

Cursor Agent committed 8 months ago

Commit a13ed501 parent 88d60031 file · +2 −1Browse files

Unified · Split

apps/desktop/scripts/dev-electron.mjs+2−1
@@ -1,6 +1,7 @@
11 import { spawn } from "node:child_process";
22 import fs from "node:fs";
33 import net from "node:net";
4+import path from "node:path";
45
56 const port = Number(process.env.ELECTRON_RENDERER_PORT ?? 5173);
67 const STARTUP_TIMEOUT_MS = Number(process.env.T3CODE_ELECTRON_STARTUP_TIMEOUT_MS ?? 120_000);
@@ -25,7 +26,7 @@ async function canConnect(host, probePort, timeoutMs = 1_000) { · 18 unmodified lines
2526 });
2627 }
2728
28−const f = (path) => path.join(import.meta.dirname, "..", path);
29+const f = (p) => path.join(import.meta.dirname, "..", p);
2930
3031 function waitForDesktopBundles(timeoutMs) {
3132 const FRESHNESS_GRACE_MS = 10_000;