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.
Unified · Split
| @@ -1,6 +1,7 @@ | |||
| 1 | import { spawn } from "node:child_process"; | 1 | import { spawn } from "node:child_process"; |
| 2 | import fs from "node:fs"; | 2 | import fs from "node:fs"; |
| 3 | import net from "node:net"; | 3 | import net from "node:net"; |
| 4 | import path from "node:path"; | ||
| 4 | 5 | ||
| 5 | const port = Number(process.env.ELECTRON_RENDERER_PORT ?? 5173); | 6 | const port = Number(process.env.ELECTRON_RENDERER_PORT ?? 5173); |
| 6 | const STARTUP_TIMEOUT_MS = Number(process.env.T3CODE_ELECTRON_STARTUP_TIMEOUT_MS ?? 120_000); | 7 | 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 | |||
| 25 | }); | 26 | }); |
| 26 | } | 27 | } |
| 27 | 28 | ||
| 28 | const f = (path) => path.join(import.meta.dirname, "..", path); | 29 | const f = (p) => path.join(import.meta.dirname, "..", p); |
| 29 | 30 | ||
| 30 | function waitForDesktopBundles(timeoutMs) { | 31 | function waitForDesktopBundles(timeoutMs) { |
| 31 | const FRESHNESS_GRACE_MS = 10_000; | 32 | const FRESHNESS_GRACE_MS = 10_000; |