Closed Patrick-Shih closed 2 hours ago
Hey @Patrick-Shih,
You need to wrap properties in your annotation like this:
// Define the graph state
// See here for more info: https://langchain-ai.github.io/langgraphjs/how-tos/define-state/
const StateAnnotation = Annotation.Root({
// Annotation here too!
messages: Annotation({
reducer: (x, y) => x.concat(y),
}),
});
TypeScript is not required (it never is) but we generally recommend it since you avoid pitfalls like this!
I simply copy the entire example within a fresh start project, run it with node V18.18.2, and get the error.
I think the only difference are:
I wonder is using typeScript a must to use langgraph? or it is something eles?
Following is the package.json
Following is the error
Following is the code langGraphPoc.js