Error: Failed to extract schema for "chat": TypeError: Cannot read properties of undefined (reading 'flags') #180

Closed
opened 2026-02-15 17:16:51 -05:00 by yindo · 8 comments
Owner

Originally created by @benji56 on GitHub (Feb 28, 2025).

what could cause this error?

"@langchain/community": "^0.3.33",
"@langchain/core": "^0.3.41",
"@langchain/langgraph": "^0.2.49",
"@langchain/openai": "^0.4.4",

info: ▪ <-- GET /assistants/eb6db400-e3c8-5d06-a834-015cb89efe69/schemas
Error: Failed to extract schema for "chat": TypeError: Cannot read properties of undefined (reading 'flags')
at getGraphSchema (file:///C:/Users/username/AppData/Local/npm-cache/_npx/8b41b8d3955bcda6/node_modules/@langchain/langgraph-api/dist/graph/load.mjs:68:19)
at async file:///C:/Users/username/AppData/Local/npm-cache/_npx/8b41b8d3955bcda6/node_modules/@langchain/langgraph-api/dist/api/assistants.mjs:90:25
at async dispatch (file:///C:/Users/username/AppData/Local/npm-cache/_npx/8b41b8d3955bcda6/node_modules/hono/dist/compose.js:22:17)
at async logger2 (file:///C:/Users/username/AppData/Local/npm-cache/_npx/8b41b8d3955bcda6/node_modules/hono/dist/middleware/logger/index.js:38:5)
at async dispatch (file:///C:/Users/username/AppData/Local/npm-cache/_npx/8b41b8d3955bcda6/node_modules/hono/dist/compose.js:22:17)
at async cors2 (file:///C:/Users/username/AppData/Local/npm-cache/_npx/8b41b8d3955bcda6/node_modules/hono/dist/middleware/cors/index.js:74:5)
at async dispatch (file:///C:/Users/username/AppData/Local/npm-cache/_npx/8b41b8d3955bcda6/node_modules/hono/dist/compose.js:22:17)
at async file:///C:/Users/username/AppData/Local/npm-cache/_npx/8b41b8d3955bcda6/node_modules/@langchain/langgraph-api/dist/server.mjs:26:5
at async dispatch (file:///C:/Users/username/AppData/Local/npm-cache/_npx/8b41b8d3955bcda6/node_modules/hono/dist/compose.js:22:17)
at async file:///C:/Users/username/AppData/Local/npm-cache/_npx/8b41b8d3955bcda6/node_modules/hono/dist/hono-base.js:195:25
info: ▪ --> GET /assistants/eb6db400-e3c8-5d06-a834-015cb89efe69/schemas 500 2s

Originally created by @benji56 on GitHub (Feb 28, 2025). what could cause this error? "@langchain/community": "^0.3.33", "@langchain/core": "^0.3.41", "@langchain/langgraph": "^0.2.49", "@langchain/openai": "^0.4.4", info: ▪ <-- GET /assistants/eb6db400-e3c8-5d06-a834-015cb89efe69/schemas Error: Failed to extract schema for "chat": TypeError: Cannot read properties of undefined (reading 'flags') at getGraphSchema (file:///C:/Users/username/AppData/Local/npm-cache/_npx/8b41b8d3955bcda6/node_modules/@langchain/langgraph-api/dist/graph/load.mjs:68:19) at async file:///C:/Users/username/AppData/Local/npm-cache/_npx/8b41b8d3955bcda6/node_modules/@langchain/langgraph-api/dist/api/assistants.mjs:90:25 at async dispatch (file:///C:/Users/username/AppData/Local/npm-cache/_npx/8b41b8d3955bcda6/node_modules/hono/dist/compose.js:22:17) at async logger2 (file:///C:/Users/username/AppData/Local/npm-cache/_npx/8b41b8d3955bcda6/node_modules/hono/dist/middleware/logger/index.js:38:5) at async dispatch (file:///C:/Users/username/AppData/Local/npm-cache/_npx/8b41b8d3955bcda6/node_modules/hono/dist/compose.js:22:17) at async cors2 (file:///C:/Users/username/AppData/Local/npm-cache/_npx/8b41b8d3955bcda6/node_modules/hono/dist/middleware/cors/index.js:74:5) at async dispatch (file:///C:/Users/username/AppData/Local/npm-cache/_npx/8b41b8d3955bcda6/node_modules/hono/dist/compose.js:22:17) at async file:///C:/Users/username/AppData/Local/npm-cache/_npx/8b41b8d3955bcda6/node_modules/@langchain/langgraph-api/dist/server.mjs:26:5 at async dispatch (file:///C:/Users/username/AppData/Local/npm-cache/_npx/8b41b8d3955bcda6/node_modules/hono/dist/compose.js:22:17) at async file:///C:/Users/username/AppData/Local/npm-cache/_npx/8b41b8d3955bcda6/node_modules/hono/dist/hono-base.js:195:25 info: ▪ --> GET /assistants/eb6db400-e3c8-5d06-a834-015cb89efe69/schemas 500 2s
yindo closed this issue 2026-02-15 17:16:51 -05:00
Author
Owner

@benji56 commented on GitHub (Feb 28, 2025):

It was resolved by porting my project to TypeScript.

@benji56 commented on GitHub (Feb 28, 2025): It was resolved by porting my project to TypeScript.
Author
Owner

@benji56 commented on GitHub (Feb 28, 2025):

Now that I've spent hours suffering with TypeScript, I'm not willing to torture myself any longer. Can someone explain why this doesn't work with plain JavaScript?

@benji56 commented on GitHub (Feb 28, 2025): Now that I've spent hours suffering with TypeScript, I'm not willing to torture myself any longer. Can someone explain why this doesn't work with plain JavaScript?
Author
Owner

@Yishin26 commented on GitHub (Apr 9, 2025):

I have the same problem. only change to ts to solve.

@Yishin26 commented on GitHub (Apr 9, 2025): I have the same problem. only change to ts to solve.
Author
Owner

@benjamincburns commented on GitHub (Apr 28, 2025):

Can someone explain why this doesn't work with plain JavaScript?

@benji56, @Yishin26 I'm afraid that I don't have enough detail here to answer this question. If either of you can share a minimal reproducible example along with reproduction steps, that would help quite a bit.

@benjamincburns commented on GitHub (Apr 28, 2025): > Can someone explain why this doesn't work with plain JavaScript? @benji56, @Yishin26 I'm afraid that I don't have enough detail here to answer this question. If either of you can share a [minimal reproducible example](https://en.wikipedia.org/wiki/Minimal_reproducible_example) along with reproduction steps, that would help quite a bit.
Author
Owner

@benjamincburns commented on GitHub (Apr 28, 2025):

Also cc @dqbd in case he is more familiar with what's going on here than I am.

@benjamincburns commented on GitHub (Apr 28, 2025): Also cc @dqbd in case he is more familiar with what's going on here than I am.
Author
Owner

@dqbd commented on GitHub (May 19, 2025):

Hello! Unfortunately we do rely on TypeScript to properly infer schema for LangGraph Studio when using AnnotationRoot / Annotation.

If you do want to use JavaScript instead, we do offer an option to use Zod for state definition, which I believe should work without TypeScript

https://langchain-ai.github.io/langgraphjs/how-tos/define-state/?h=zod#using-zod

@dqbd commented on GitHub (May 19, 2025): Hello! Unfortunately we do rely on TypeScript to properly infer schema for LangGraph Studio when using `AnnotationRoot` / `Annotation`. If you do want to use JavaScript instead, we do offer an option to use Zod for state definition, which I believe should work without TypeScript https://langchain-ai.github.io/langgraphjs/how-tos/define-state/?h=zod#using-zod
Author
Owner

@amitchaudharyc commented on GitHub (Jul 31, 2025):

Hey @benjamincburns @dqbd Any luck on how to resolve this?

@amitchaudharyc commented on GitHub (Jul 31, 2025): Hey @benjamincburns @dqbd Any luck on how to resolve this?
Author
Owner

@amitchaudharyc commented on GitHub (Jul 31, 2025):

Just found the answer. I downgraded the node version to 20.13.1 and it worked.

@amitchaudharyc commented on GitHub (Jul 31, 2025): Just found the answer. I downgraded the node version to 20.13.1 and it worked.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#180