mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-30 11:49:38 +02:00
Do not throw error if window is undefined due to Next
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user