From 3ba7c7fbed17bcc5e1c80e4d7f55f347fcb18a37 Mon Sep 17 00:00:00 2001 From: Tat Dat Duong Date: Thu, 27 Mar 2025 21:03:54 +0100 Subject: [PATCH] Do not throw error if window is undefined due to Next --- libs/sdk-js/src/react-ui/client.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libs/sdk-js/src/react-ui/client.tsx b/libs/sdk-js/src/react-ui/client.tsx index 4ede43aa2..ab5d4abe0 100644 --- a/libs/sdk-js/src/react-ui/client.tsx +++ b/libs/sdk-js/src/react-ui/client.tsx @@ -203,9 +203,7 @@ declare global { } export function experimental_loadShare(name: string, module: unknown) { - if (typeof window === "undefined") { - throw new Error("Cannot register module in server context"); - } + if (typeof window === "undefined") return; window[REQUIRE_EXTRA_SYMBOL] ??= {}; window[REQUIRE_EXTRA_SYMBOL][name] = module;