diff --git a/packages/backend-core/src/context/types.ts b/packages/backend-core/src/context/types.ts index 65e9a3778a..06f75ce6af 100644 --- a/packages/backend-core/src/context/types.ts +++ b/packages/backend-core/src/context/types.ts @@ -10,6 +10,6 @@ export type ContextMap = { isScim?: boolean automationId?: string isMigrating?: boolean - jsIsolate: Isolate - jsContext: Context + jsIsolate?: Isolate + jsContext?: Context } diff --git a/packages/server/src/jsRunner.ts b/packages/server/src/jsRunner.ts index 5d3face3d8..cdc619ebc0 100644 --- a/packages/server/src/jsRunner.ts +++ b/packages/server/src/jsRunner.ts @@ -33,7 +33,7 @@ export function init() { } } - const global = bbCtx.jsContext.global + const global = bbCtx.jsContext!.global for (const [key, value] of Object.entries(ctx)) { if (typeof value === "function") { // Can't copy functions into the isolate, so we just ignore them @@ -43,7 +43,7 @@ export function init() { } const script = bbCtx.jsIsolate.compileScriptSync(js) - return script.runSync(bbCtx.jsContext, { + return script.runSync(bbCtx.jsContext!, { timeout: env.JS_PER_EXECUTION_TIME_LIMIT_MS, }) })