-
Notifications
You must be signed in to change notification settings - Fork 316
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Checked other resources
- I added a very descriptive title to this issue.
- I searched the LangGraph.js documentation with the integrated search.
- I used the GitHub search to find a similar question and didn't find it.
- I am sure that this is a bug in LangGraph.js rather than my code.
- The bug is not resolved by updating to the latest stable version of LangGraph (or the specific integration package).
Example Code
import "@langchain/langgraph/zod";
import { StateGraph } from "@langchain/langgraph";
import { z } from "zod";
const AgentState = z.object({
question: z.string(),
answer: z.string().min(1),
});
const graph = new StateGraph(AgentState);
Error Message and Stack Trace (if applicable)
No overload matches this call.
The last overload gave the following error.
Argument of type 'ZodObject<{ question: ZodString; answer: ZodString; }, $strip>' is not assignable to parameter of type 'never'.ts(2769)
state.d.ts(142, 5): The last overload is declared here.
Description
Trying to use the latest zod
release (4.0) in a StateGraph
results in the famous not assignable to parameter of type 'never'
typescript error.
It seems that running the code doesn't produce a runtime error. But validation (via import "@langchain/langgraph/zod"
) doesn't seem to happen either.
System Info
@langchain/langgraph
: 0.4.0zod
: 4.0.11- Package manager:
bun
mkamrani and raffpaquindqbd, piyey and igillis-clara
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working