TypeError: (0 , types_1.isInteropZodObject) is not a function on new StateGraph #299

Closed
opened 2026-02-15 18:15:37 -05:00 by yindo · 5 comments
Owner

Originally created by @jclaessens97 on GitHub (Jul 10, 2025).

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 { Annotation, END, START, StateGraph } from '@langchain/langgraph';
import { registry as langgraphMeta } from '@langchain/langgraph/zod';
import { z } from 'zod/v4';

const StateSchema = z.object({
  exampleList: z.array(z.number()).register(langgraphMeta, { // type error on langgraphMeta
    reducer: {
      schema: z.number(),
      fn: (a, b) => a.concat([b]).slice(-10),
    },
    default: () => [],
  }),
});

const graph = new StateGraph(StateSchema); // Throws the error described in title
console.log(graph);

Error Message and Stack Trace (if applicable)

TypeError: (0 , types_1.isInteropZodObject) is not a function
    at new StateGraph (/Users/jclaessens/dev/node_modules/.pnpm/@langchain+langgraph@0.3.7_@langchain+core@0.3.56_openai@4.100.0_ws@8.18.2_zod@3.25.75___reac_og7ddq7rhqrfybrnnkeeqxjtea/node_modules/@langchain/langgraph/src/graph/state.ts:327:45)
    at new Supervisor (/Users/jclaessens/dev/apps/core-api/src/agents/index.ts:40:18)
    at <anonymous> (/Users/jclaessens/dev/apps/core-api/src/workflows/core.ts:38:22)
    at Object.fn (/Users/jclaessens/dev/node_modules/.pnpm/inngest@3.40.1_@vercel+node@5.0.4_rollup@4.35.0__express@5.1.0_fastify@5.4.0_next@15.3.2_@ope_wmg4hbxcx5iaobcdnipo4vyfnu/node_modules/src/components/InngestStepTools.ts:243:34)
    at Object.assign.fn (/Users/jclaessens/dev/node_modules/.pnpm/inngest@3.40.1_@vercel+node@5.0.4_rollup@4.35.0__express@5.1.0_fastify@5.4.0_next@15.3.2_@ope_wmg4hbxcx5iaobcdnipo4vyfnu/node_modules/src/components/execution/v1.ts:981:37)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

Description

I'm trying to build a new StateGraph using langGraph v0.3.7. It works until v0.3.2, after that it breaks. I've tried using Annotation.Root syntax:

const stateSchema = Annotation.Root({
  userInput: Annotation<string>(),
  intent: Annotation<string>(),
  selectedAgent: Annotation<AgentName | null>(),
  agentResponse: Annotation<unknown>(),
  isComplete: Annotation<boolean>(),
});

and via the zod syntax I saw in the v0.3.2 release notes (see example code).

System Info

  "dependencies": {
    "@langchain/core": "0.3.62",
    "@langchain/langgraph": "0.3.7",
    "zod": "4.0.1"
  }
❯ pnpx envinfo --system --binaries

  System:
    OS: macOS 15.5
    CPU: (10) arm64 Apple M1 Max
    Memory: 651.08 MB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.17.0 - ~/.asdf/installs/nodejs/22.17.0/bin/node
    Yarn: 1.22.22 - /opt/homebrew/bin/yarn
    npm: 10.9.2 - ~/.asdf/plugins/nodejs/shims/npm
    pnpm: 9.14.4 - ~/Library/pnpm/pnpm
    Watchman: 2025.05.26.00 - /opt/homebrew/bin/watchman
Originally created by @jclaessens97 on GitHub (Jul 10, 2025). ### Checked other resources - [x] I added a very descriptive title to this issue. - [x] I searched the LangGraph.js documentation with the integrated search. - [x] I used the GitHub search to find a similar question and didn't find it. - [x] I am sure that this is a bug in LangGraph.js rather than my code. - [x] The bug is not resolved by updating to the latest stable version of LangGraph (or the specific integration package). ### Example Code ```typescript import { Annotation, END, START, StateGraph } from '@langchain/langgraph'; import { registry as langgraphMeta } from '@langchain/langgraph/zod'; import { z } from 'zod/v4'; const StateSchema = z.object({ exampleList: z.array(z.number()).register(langgraphMeta, { // type error on langgraphMeta reducer: { schema: z.number(), fn: (a, b) => a.concat([b]).slice(-10), }, default: () => [], }), }); const graph = new StateGraph(StateSchema); // Throws the error described in title console.log(graph); ``` ### Error Message and Stack Trace (if applicable) ``` TypeError: (0 , types_1.isInteropZodObject) is not a function at new StateGraph (/Users/jclaessens/dev/node_modules/.pnpm/@langchain+langgraph@0.3.7_@langchain+core@0.3.56_openai@4.100.0_ws@8.18.2_zod@3.25.75___reac_og7ddq7rhqrfybrnnkeeqxjtea/node_modules/@langchain/langgraph/src/graph/state.ts:327:45) at new Supervisor (/Users/jclaessens/dev/apps/core-api/src/agents/index.ts:40:18) at <anonymous> (/Users/jclaessens/dev/apps/core-api/src/workflows/core.ts:38:22) at Object.fn (/Users/jclaessens/dev/node_modules/.pnpm/inngest@3.40.1_@vercel+node@5.0.4_rollup@4.35.0__express@5.1.0_fastify@5.4.0_next@15.3.2_@ope_wmg4hbxcx5iaobcdnipo4vyfnu/node_modules/src/components/InngestStepTools.ts:243:34) at Object.assign.fn (/Users/jclaessens/dev/node_modules/.pnpm/inngest@3.40.1_@vercel+node@5.0.4_rollup@4.35.0__express@5.1.0_fastify@5.4.0_next@15.3.2_@ope_wmg4hbxcx5iaobcdnipo4vyfnu/node_modules/src/components/execution/v1.ts:981:37) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) ``` ### Description I'm trying to build a new StateGraph using langGraph `v0.3.7`. It works until `v0.3.2`, after that it breaks. I've tried using `Annotation.Root` syntax: ```typescript const stateSchema = Annotation.Root({ userInput: Annotation<string>(), intent: Annotation<string>(), selectedAgent: Annotation<AgentName | null>(), agentResponse: Annotation<unknown>(), isComplete: Annotation<boolean>(), }); ``` and via the zod syntax I saw in the `v0.3.2` release notes (see example code). ### System Info ```json "dependencies": { "@langchain/core": "0.3.62", "@langchain/langgraph": "0.3.7", "zod": "4.0.1" } ``` ```shell ❯ pnpx envinfo --system --binaries System: OS: macOS 15.5 CPU: (10) arm64 Apple M1 Max Memory: 651.08 MB / 64.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 22.17.0 - ~/.asdf/installs/nodejs/22.17.0/bin/node Yarn: 1.22.22 - /opt/homebrew/bin/yarn npm: 10.9.2 - ~/.asdf/plugins/nodejs/shims/npm pnpm: 9.14.4 - ~/Library/pnpm/pnpm Watchman: 2025.05.26.00 - /opt/homebrew/bin/watchman ```
yindo closed this issue 2026-02-15 18:15:37 -05:00
Author
Owner

@dqbd commented on GitHub (Jul 10, 2025):

Hello! That does seem strange, can you check if you don't have multiple versions of @langchain/core installed? Would also check if in the output of pnpm ls "@langchain/*" --depth Infinity

@dqbd commented on GitHub (Jul 10, 2025): Hello! That does seem strange, can you check if you don't have multiple versions of `@langchain/core` installed? Would also check if in the output of `pnpm ls "@langchain/*" --depth Infinity`
Author
Owner

@Pines-Cheng commented on GitHub (Jul 10, 2025):

I've encountered the same problem. Have you solved it yet?

@Pines-Cheng commented on GitHub (Jul 10, 2025): I've encountered the same problem. Have you solved it yet?
Author
Owner

@Pines-Cheng commented on GitHub (Jul 10, 2025):

I think I found the reason: Only @langchain/core >= 0.3.58,has export the isInteropZodObject method.

Image Image
@Pines-Cheng commented on GitHub (Jul 10, 2025): I think I found the reason: Only @langchain/core >= 0.3.58,has export the isInteropZodObject method. <img width="2352" height="1368" alt="Image" src="https://github.com/user-attachments/assets/358ffa2c-6a1c-4651-9075-cf4002b0f57b" /> <img width="2644" height="1316" alt="Image" src="https://github.com/user-attachments/assets/80e056da-4648-4867-8d34-61fea68af1e2" />
Author
Owner

@oneWalker commented on GitHub (Jul 11, 2025):

I've encountered the same problem. Have you solved it yet?

Update the @langchain/core to the latest one.
Removed node_module and cached to make sure it's an old one.
Reinstall all packages.

@oneWalker commented on GitHub (Jul 11, 2025): > I've encountered the same problem. Have you solved it yet? Update the @langchain/core to the latest one. Removed node_module and cached to make sure it's an old one. Reinstall all packages.
Author
Owner

@dqbd commented on GitHub (Jul 15, 2025):

Checked that we're properly specifying peerDependencies for @langchain/langgraph. Closing this issue

@dqbd commented on GitHub (Jul 15, 2025): Checked that we're properly specifying `peerDependencies` for `@langchain/langgraph`. Closing this issue
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#299