From 7c298653f1ec0b7e06c09583e6f1f6fcd967c0c7 Mon Sep 17 00:00:00 2001 From: Asher Date: Fri, 18 Oct 2024 10:06:57 -0800 Subject: [PATCH] Fix import of server-main.js from main Neglected to update this import when fixing the other. --- src/node/main.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/node/main.ts b/src/node/main.ts index 0458f66ad..f331ae59f 100644 --- a/src/node/main.ts +++ b/src/node/main.ts @@ -49,7 +49,9 @@ export interface OpenCommandPipeArgs { export const runCodeCli = async (args: DefaultedArgs): Promise => { logger.debug("Running Code CLI") try { - const mod = require(path.join(vsRootPath, "out/server-main")) as VSCodeModule + // See vscode.loadVSCode for more on this jank. + const modPath = path.join(vsRootPath, "out/server-main.js") + const mod = (await eval(`import("${modPath}")`)) as VSCodeModule const serverModule = await mod.loadCodeWithNls() await serverModule.spawnCli(await toCodeArgs(args)) // Rather than have the caller handle errors and exit, spawnCli will exit