diff --git a/packages/server/src/jsRunner.ts b/packages/server/src/jsRunner.ts index 14ad5bedaa..237b97b356 100644 --- a/packages/server/src/jsRunner.ts +++ b/packages/server/src/jsRunner.ts @@ -105,8 +105,10 @@ export function init() { } } + // We need to warp up the actual run in a `cb` function to be able to extract its value from isolated-vm + js = js.replace(/run\(\);$/, "cb(run());") const script = jsIsolate.compileModuleSync( - `import helpers from "compiled_module";${js};cb(run());`, + `import helpers from "compiled_module";${js}`, {} )