Skip to content

Commit e0b65cc

Browse files
authored
fix(langgraph): improve error message when attempting to pass an invalid argument to StateGraph (#1233)
2 parents c9e96aa + 730cb8e commit e0b65cc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libs/langgraph/src/graph/state.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,9 @@ export class StateGraph<
329329
const spec = _getChannels(fields.channels);
330330
this._schemaDefinition = spec;
331331
} else {
332-
throw new Error("Invalid StateGraph input.");
332+
throw new Error(
333+
"Invalid StateGraph input. Make sure to pass a valid Annotation.Root or Zod schema."
334+
);
333335
}
334336

335337
this._inputDefinition ??= this._schemaDefinition as I;

0 commit comments

Comments
 (0)