diff --git a/compiler/forget/packages/playground/components/Editor/index.tsx b/compiler/forget/packages/playground/components/Editor/index.tsx index 26837ed606..9cea6e046a 100644 --- a/compiler/forget/packages/playground/components/Editor/index.tsx +++ b/compiler/forget/packages/playground/components/Editor/index.tsx @@ -67,6 +67,11 @@ function compile(source: string): CompilerOutput { return { kind: "ok", results }; } catch (error: any) { console.error(error); + // error might be an invariant violation or other runtime error + // (i.e. object shape that is not CompilerError) + if (error.details == null) { + error.details = []; + } return { kind: "err", error }; } }