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. Fix: import `node:path` and rename the parameter to `p`.
This commit is contained in:
1 parent
88d600370b
commit
a13ed5078c
1 file changed
+2
-1
@@ -1,6 +1,7 @@
|
||||
import { spawn } from "node:child_process";
|
||||
import fs from "node:fs";
|
||||
import net from "node:net";
|
||||
import path from "node:path";
|
||||
|
||||
const port = Number(process.env.ELECTRON_RENDERER_PORT ?? 5173);
|
||||
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) {
|
||||
});
|
||||
}
|
||||
|
||||
const f = (path) => path.join(import.meta.dirname, "..", path);
|
||||
const f = (p) => path.join(import.meta.dirname, "..", p);
|
||||
|
||||
function waitForDesktopBundles(timeoutMs) {
|
||||
const FRESHNESS_GRACE_MS = 10_000;
|
||||
|
||||
Reference in new issue
Block a user