[GH-ISSUE #530] [langgraph]: please, someone do the simplest thing of putting the js docs into an IDE and seeing all the errors #84

Closed
opened 2026-02-17 17:19:08 -05:00 by yindo · 1 comment
Owner

Originally created by @markgoho on GitHub (Sep 13, 2025).
Original GitHub issue: https://github.com/langchain-ai/docs/issues/530

Type of issue

issue / bug

Language

JavaScript

Description

lots of errors in the quickstart for LangGraph -- would be fixed by not relying on .mdx files...but here we are

All the tools have the fundamental error of the tool functions argument being typed as any instead of being inferred from the schema.

Image
const add = tool(({ a, b }) => a + b, {
  name: 'add',
  description: 'Add two numbers',
  schema: z.object({
    a: z.number().describe('First number'),
    b: z.number().describe('Second number'),
  }),
});

The argument type passed into new StateGraph seems to be pretty messed up.

Image
const agent = new StateGraph(MessagesState)
  .addNode('llmCall', llmCall)
  .addNode('toolNode', toolNode)
  .addEdge(START, 'llmCall')
  .addConditionalEdges('llmCall', shouldContinue, ['toolNode', END])
  .addEdge('toolNode', 'llmCall')
  .compile();

I can't find a single valid example of passing in a State-type object to new StateGraph() that doesn't error out like this.

This code wouldn't pass most enterprise-level typechecking.

Additionally, the shouldContinue has an error, but it's too long to take a screenshot of, can someone who actually uses TypeScript take a look at the TS documentation and make sure it isn't riddled with errors?

Finally, result.message is of type unknown and so you can't iterate over it because it's not an array or something else iterable.

for (const message of result.messages) {
  console.log(`[${message.getType()}]: ${message.text}`);
}
Originally created by @markgoho on GitHub (Sep 13, 2025). Original GitHub issue: https://github.com/langchain-ai/docs/issues/530 ### Type of issue issue / bug ### Language JavaScript ### Description lots of errors in the quickstart for LangGraph -- would be fixed by not relying on .mdx files...but here we are All the tools have the fundamental error of the tool functions argument being typed as any instead of being inferred from the schema. <img width="882" height="148" alt="Image" src="https://github.com/user-attachments/assets/862be4bd-467a-4773-a4ac-73161be4790a" /> ```typescript const add = tool(({ a, b }) => a + b, { name: 'add', description: 'Add two numbers', schema: z.object({ a: z.number().describe('First number'), b: z.number().describe('Second number'), }), }); ``` The argument type passed into `new StateGraph` seems to be pretty messed up. <img width="843" height="133" alt="Image" src="https://github.com/user-attachments/assets/3bde5406-6da6-4988-9494-f816b8c4340a" /> ```typescript const agent = new StateGraph(MessagesState) .addNode('llmCall', llmCall) .addNode('toolNode', toolNode) .addEdge(START, 'llmCall') .addConditionalEdges('llmCall', shouldContinue, ['toolNode', END]) .addEdge('toolNode', 'llmCall') .compile(); ``` I can't find a single valid example of passing in a State-type object to `new StateGraph()` that doesn't error out like this. This code wouldn't pass most enterprise-level typechecking. Additionally, the `shouldContinue` has an error, but it's too long to take a screenshot of, can someone who actually uses TypeScript take a look at the TS documentation and make sure it isn't riddled with errors? Finally, result.message is of type unknown and so you can't iterate over it because it's not an array or something else iterable. ```typescript for (const message of result.messages) { console.log(`[${message.getType()}]: ${message.text}`); } ```
yindo added the langgraph label 2026-02-17 17:19:08 -05:00
yindo closed this issue 2026-02-17 17:19:08 -05:00
Author
Owner

@hntrl commented on GitHub (Sep 22, 2025):

Hey @markgoho! Apologies for this, I know how frustrating this can be (these are just some of the many joys of being in an alpha). We're working to make these code examples more resilient as a CI step in #623, and we'll work to fix some of the latent issues with these examples in the coming weeks.

Thanks for your understanding!

@hntrl commented on GitHub (Sep 22, 2025): Hey @markgoho! Apologies for this, I know how frustrating this can be (these are just some of the many joys of being in an alpha). We're working to make these code examples more resilient as a CI step in #623, and we'll work to fix some of the latent issues with these examples in the coming weeks. Thanks for your understanding!
yindo changed title from [langgraph]: please, someone do the simplest thing of putting the js docs into an IDE and seeing all the errors to [GH-ISSUE #530] [langgraph]: please, someone do the simplest thing of putting the js docs into an IDE and seeing all the errors 2026-06-05 17:24:59 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#84