Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion webworker/entrypoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ import { setValueAtPath } from "lib/shared/obj-path"
globalThis.React = React
setupFetchProxy()

// Polyfill for Node.js global object in browser workers
// Needed because @tscircuit/core and dependencies reference global.debugGraphics/debugOutputArray
globalThis.global = globalThis.global || globalThis

let executionContext: ExecutionContext | null = null
let debugNamespace: string | undefined

Expand Down Expand Up @@ -196,7 +200,7 @@ const webWorkerApi = {
let element: any
if (typeof component === "function") {
element = component()
} else if (component && component.__isSerializedReactElement) {
} else if (component?.__isSerializedReactElement) {
element = deserializeReactElement(component)
} else {
element = component
Expand Down