🐛 Bug: isInteropZodObject is not exported from @langchain/core/utils/types #322

Closed
opened 2026-02-15 18:15:54 -05:00 by yindo · 1 comment
Owner

Originally created by @RABrL on GitHub (Jul 31, 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 { END, START, StateGraph } from '@langchain/langgraph'

export function agentExecutor() {
  const workflow = new StateGraph<AgentExecutorState>({
    channels: {
      workflow: null,
      next: {
        default: () => 'invokeModel',
        reducer: (prev: string | null, update: string | null) => update ?? null
      },
      messages: {
        default: () => [],
        reducer: (
          prev: ThreadMessageType[],
          update: ThreadMessageType[] | undefined
        ) => {
          if (!update) return prev
          const newMessages = [...prev]
          for (const msg of update) {
            const index = prev.findIndex((m) => m.id === msg.id)
            if (index !== -1) {
              newMessages[index] = msg
            } else {
              newMessages.push(msg)
            }
          }
          return newMessages
        }
      },
      onEnd: null
    }
  })
    .addNode('invokeModel', invokeModel)
    .addNode('invokeTools', invokeTools)
    .addNode('runWorkflow', runWorkflow)

  workflow.addConditionalEdges(START, router)
  workflow.addConditionalEdges('runWorkflow', router)
  workflow.addConditionalEdges('invokeModel', router)
  workflow.addConditionalEdges('invokeTools', router)

  const graph = workflow.compile()
  return graph
}

Error Message and Stack Trace (if applicable)

../../node_modules/.pnpm/@langchain+openai@0.6.3_@langchain+core@0.2.17/node_modules/@langchain/openai/dist/chat_models.js
Attempted import error: 'isDataContentBlock' is not exported from '@langchain/core/messages' (imported as 'isDataContentBlock').

Description

After upgrading from Zod v3 to Zod v4, I started getting the following error immediately when starting my Node.js application:

Attempted import error: 'isInteropZodObject' is not exported from '@langchain/core/utils/types' (imported as 'isInteropZodObject').

I’m not directly importing isInteropZodObject in my own code. The error occurs during the initialization phase, and I’ve traced it back to a module that uses the StateGraph class from @langchain/langgraph.

System Info

Node version: 23.6.0
Zod version: 4.0.14
Langchain-related versions:

{
  "@langchain/community": "^0.3.48",
  "@langchain/core": "^0.3.66",
  "@langchain/langgraph": "^0.4.1",
  "@langchain/openai": "^0.6.3",
  "langchain": "^0.3.30"
}
Originally created by @RABrL on GitHub (Jul 31, 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 { END, START, StateGraph } from '@langchain/langgraph' export function agentExecutor() { const workflow = new StateGraph<AgentExecutorState>({ channels: { workflow: null, next: { default: () => 'invokeModel', reducer: (prev: string | null, update: string | null) => update ?? null }, messages: { default: () => [], reducer: ( prev: ThreadMessageType[], update: ThreadMessageType[] | undefined ) => { if (!update) return prev const newMessages = [...prev] for (const msg of update) { const index = prev.findIndex((m) => m.id === msg.id) if (index !== -1) { newMessages[index] = msg } else { newMessages.push(msg) } } return newMessages } }, onEnd: null } }) .addNode('invokeModel', invokeModel) .addNode('invokeTools', invokeTools) .addNode('runWorkflow', runWorkflow) workflow.addConditionalEdges(START, router) workflow.addConditionalEdges('runWorkflow', router) workflow.addConditionalEdges('invokeModel', router) workflow.addConditionalEdges('invokeTools', router) const graph = workflow.compile() return graph } ``` ### Error Message and Stack Trace (if applicable) ../../node_modules/.pnpm/@langchain+openai@0.6.3_@langchain+core@0.2.17/node_modules/@langchain/openai/dist/chat_models.js Attempted import error: 'isDataContentBlock' is not exported from '@langchain/core/messages' (imported as 'isDataContentBlock'). ### Description After upgrading from Zod v3 to Zod v4, I started getting the following error immediately when starting my Node.js application: ``` Attempted import error: 'isInteropZodObject' is not exported from '@langchain/core/utils/types' (imported as 'isInteropZodObject'). ``` I’m not directly importing isInteropZodObject in my own code. The error occurs during the initialization phase, and I’ve traced it back to a module that uses the StateGraph class from @langchain/langgraph. ### System Info Node version: 23.6.0 Zod version: 4.0.14 Langchain-related versions: ```json { "@langchain/community": "^0.3.48", "@langchain/core": "^0.3.66", "@langchain/langgraph": "^0.4.1", "@langchain/openai": "^0.6.3", "langchain": "^0.3.30" } ```
yindo added the question label 2026-02-15 18:15:54 -05:00
yindo closed this issue 2026-02-15 18:15:54 -05:00
Author
Owner

@dqbd commented on GitHub (Aug 4, 2025):

Hello! It does seem like you're having multiple versions of @langchain/core installed. Can you paste the output of pnpm why @langchain/core@0.2.17?

@dqbd commented on GitHub (Aug 4, 2025): Hello! It does seem like you're having multiple versions of `@langchain/core` installed. Can you paste the output of `pnpm why @langchain/core@0.2.17`?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#322