From e44b9e5d6715f3ab4f7ee12bc4941acb8e20c04e Mon Sep 17 00:00:00 2001 From: hitesh-shetty-cstk Date: Wed, 29 Jul 2026 15:10:47 +0530 Subject: [PATCH] fix: isolate goober pragma from host app to prevent react-hot-toast crash VisualBuilder called goober's setup(h) with Preact's h at init, which mutates goober's shared global pragma. A host app that also uses a goober-backed library such as react-hot-toast then renders through that pragma, emitting Preact elements into a React 19 tree and crashing with "A React Element from an older version of React was rendered." The SDK only uses goober's css/glob/keyframes, none of which read the pragma, and never uses styled (the sole pragma consumer). setup(h) was therefore inert for the SDK and only leaked into the host. Removing it restores the pragma-free behavior the SDK shipped with before the call was introduced. Co-Authored-By: Claude --- src/visualBuilder/index.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/visualBuilder/index.ts b/src/visualBuilder/index.ts index f484f1a2..3fb234dc 100644 --- a/src/visualBuilder/index.ts +++ b/src/visualBuilder/index.ts @@ -19,9 +19,7 @@ import { resolvePageContext } from "./utils/resolvePageContext"; import visualBuilderPostMessage from "./utils/visualBuilderPostMessage"; import { VisualBuilderPostMessageEvents } from "./utils/types/postMessage.types"; -import { setup } from "goober"; import { debounce, isEqual } from "lodash-es"; -import { h } from "preact"; import { extractDetailsFromCslp, isValidCslp } from "../cslp"; import initUI from "./components"; import { useDraftFieldsPostMessageEvent } from "./eventManager/useDraftFieldsPostMessageEvent"; @@ -289,9 +287,6 @@ export class VisualBuilder { resizeObserver: this.resizeObserver, }); - // Initializing goober for css-in-js - setup(h); - this.visualBuilderContainer = document.querySelector( ".visual-builder__container" );