From 5e9da78e64421c6da88a473693f7ec138eb18026 Mon Sep 17 00:00:00 2001 From: "Jade (Rose) Rowland" Date: Fri, 14 Jun 2024 20:42:39 -0400 Subject: [PATCH] fixed window: --- packages/core/evaluate.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/core/evaluate.mjs b/packages/core/evaluate.mjs index af02a9a9..e2a4585f 100644 --- a/packages/core/evaluate.mjs +++ b/packages/core/evaluate.mjs @@ -40,7 +40,9 @@ function safeEval(str, options = {}) { export const evaluate = async (code, transpiler, transpilerOptions) => { let meta = {}; //post to iframe parent (like Udels) if it exists... - window.parent?.postMessage(code); + if (typeof window !== 'undefined') { + window.parent?.postMessage(code); + } if (transpiler) { // transform syntactically correct js code to semantically usable code const transpiled = transpiler(code, transpilerOptions);