Skip to content

The open source coding agent.

TypeScript

fix(ui): guard Node reference for SSR compatibility in isTriggerTitle (#5509)

YeonGyu-Kim210b3e905b6e
diff --git a/packages/ui/src/components/basic-tool.tsx b/packages/ui/src/components/basic-tool.tsx
index 4fab331a5ac..8fae33694f6 100644
--- a/packages/ui/src/components/basic-tool.tsx
+++ b/packages/ui/src/components/basic-tool.tsx
@@ -13,7 +13,9 @@ export type TriggerTitle = {
}
const isTriggerTitle = (val: any): val is TriggerTitle => {
- return typeof val === "object" && val !== null && "title" in val && !(val instanceof Node)
+ return (
+ typeof val === "object" && val !== null && "title" in val && (typeof Node === "undefined" || !(val instanceof Node))
+ )
}
export interface BasicToolProps {