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);