Type instantiation is excessively deep and possibly infinite with Zod 3.25.68+ #315

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

Originally created by @ddewaele on GitHub (Jul 26, 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

You can find a sample repo with the issue here : https://github.com/ddewaele/langgraph-platform-simple-agent/tree/develop/new-langchain-tavily

import {AIMessage, HumanMessage} from "@langchain/core/messages";
import { ChatOpenAI } from "@langchain/openai";
import { TavilySearch } from "@langchain/tavily"; // this one does not work. takes a long time or times out.
// import { TavilySearchResults } from "@langchain/community/tools/tavily_search"; // Using this depcrecated community version does work because it does not use zod
import { MessagesAnnotation, StateGraph } from "@langchain/langgraph";
import { ToolNode } from "@langchain/langgraph/prebuilt";

const tools = [new TavilySearch({ maxResults: 3 })];

async function callModel(state: typeof MessagesAnnotation.State) {

    const model = new ChatOpenAI({
        model: "gpt-4o",
    }).bindTools(tools);

    const response = await model.invoke([
        {
            role: "system",
            content: `You are a helpful assistant. The current date is ${new Date().getTime()}.`,
        },
        ...state.messages,
    ]);

    return { messages: response };
}

function routeModelOutput(state: typeof MessagesAnnotation.State) {
    const messages = state.messages;
    const lastMessage: AIMessage = messages[messages.length - 1];
    if ((lastMessage?.tool_calls?.length ?? 0) > 0) {
        return "tools";
    }
    return "__end__";
}

const workflow = new StateGraph(MessagesAnnotation)
    .addNode("callModel", callModel)
    .addNode("tools", new ToolNode(tools))
    .addEdge("__start__", "callModel")
    .addConditionalEdges(
        "callModel",
        routeModelOutput,
        ["tools", "__end__"]
    )
    .addEdge("tools", "callModel");

export const graph = workflow.compile();

Error Message and Stack Trace (if applicable)

base ❯ npm install
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead

> langgraph-platform-simple-agent@1.0.0 prepare
> npm run build


> langgraph-platform-simple-agent@1.0.0 build
> tsc

src/agent.ts:14:19 - error TS2589: Type instantiation is excessively deep and possibly infinite.

14     const model = new ChatOpenAI({
                     ~~~~~~~~~~~~~~~~
15         model: "gpt-4o",
   ~~~~~~~~~~~~~~~~~~~~~~~~
16     }).bindTools(tools);
   ~~~~~~~~~~~~~~~~~~~~~~~

and

info:    ▪ --> GET /assistants/453d1cbf-0bdd-5d35-a224-394f372c0502/schemas 500 30s
Error: Failed to extract schema for "assistant"
    at getCachedStaticGraphSchema (file:///Users/davydewaele/Projects/AgenticAI/nestjs-mcp/test-repo/node_modules/@langchain/langgraph-api/dist/graph/load.mjs:82:19)
    at async file:///Users/davydewaele/Projects/AgenticAI/nestjs-mcp/test-repo/node_modules/@langchain/langgraph-api/dist/api/assistants.mjs:138:33
    at async file:///Users/davydewaele/Projects/AgenticAI/nestjs-mcp/test-repo/node_modules/@langchain/langgraph-api/dist/api/assistants.mjs:133:24
    at async dispatch (file:///Users/davydewaele/Projects/AgenticAI/nestjs-mcp/test-repo/node_modules/hono/dist/compose.js:22:17)
    at async file:///Users/davydewaele/Projects/AgenticAI/nestjs-mcp/test-repo/node_modules/hono/dist/validator/validator.js:81:5
    at async dispatch (file:///Users/davydewaele/Projects/AgenticAI/nestjs-mcp/test-repo/node_modules/hono/dist/compose.js:22:17)
    at async file:///Users/davydewaele/Projects/AgenticAI/nestjs-mcp/test-repo/node_modules/hono/dist/validator/validator.js:81:5
    at async dispatch (file:///Users/davydewaele/Projects/AgenticAI/nestjs-mcp/test-repo/node_modules/hono/dist/compose.js:22:17)
    at async file:///Users/davydewaele/Projects/AgenticAI/nestjs-mcp/test-repo/node_modules/@langchain/langgraph-api/dist/http/middleware.mjs:51:9
    at async dispatch (file:///Users/davydewaele/Projects/AgenticAI/nestjs-mcp/test-repo/node_modules/hono/dist/compose.js:22:17) {
  [cause]: Error: Schema extract worker timed out
      at Timeout._onTimeout (/Users/davydewaele/Projects/AgenticAI/nestjs-mcp/test-repo/node_modules/@langchain/langgraph-api/dist/graph/parser/index.mjs:23:24)

Description

The langchainjs"zod": "^3.25.32" resolution means that the latest zod 3.x will be used in langgraphjs projects when langchainjs is used. At the time of writing this means that 3.25.76 is used.

This causes 2 issues (that can be resolved by downgrading zod to 3.25.67)

  • compilation failure during tsc
  • schema generation on langgraph / langgraph-cli dev takes a very long time (or times out)

Running npm install

The following happens when running npm install

base ❯ npm install
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead

> langgraph-platform-simple-agent@1.0.0 prepare
> npm run build


> langgraph-platform-simple-agent@1.0.0 build
> tsc

src/agent.ts:14:19 - error TS2589: Type instantiation is excessively deep and possibly infinite.

14     const model = new ChatOpenAI({
                     ~~~~~~~~~~~~~~~~
15         model: "gpt-4o",
   ~~~~~~~~~~~~~~~~~~~~~~~~
16     }).bindTools(tools);
   ~~~~~~~~~~~~~~~~~~~~~~~

Running npx @langchain/langgraph-cli dev

This will take an extremely long time and most likely timout unless you run it on a super computer

base ❯ npx @langchain/langgraph-cli dev

          Welcome to

╦  ┌─┐┌┐┌┌─┐╔═╗┬─┐┌─┐┌─┐┬ ┬
║  ├─┤││││ ┬║ ╦├┬┘├─┤├─┘├─┤
╩═╝┴ ┴┘└┘└─┘╚═╝┴└─┴ ┴┴  ┴ ┴.js

- 🚀 API: http://localhost:2024
- 🎨 Studio UI: https://smith.langchain.com/studio?baseUrl=http://localhost:2024

This in-memory server is designed for development and testing.
For production use, please use LangGraph Cloud.


info:    ▪ Starting server...
info:    ▪ Initializing storage...
info:    ▪ Registering graphs from /Users/davydewaele/Projects/AgenticAI/nestjs-mcp/langgraph-platform-simple-agent
info:    ┏ Registering graph with id 'agent'
info:    ┗ [1] { graph_id: 'agent' }
info:    ▪ Starting 10 workers
info:    ▪ Server running at ::1:2024
info:    ▪ <-- GET /assistants/fe096781-5601-53d2-b2f6-0d3403f7e9ca/schemas
info:    ▪ <-- GET /assistants/fe096781-5601-53d2-b2f6-0d3403f7e9ca
info:    ▪ --> GET /assistants/fe096781-5601-53d2-b2f6-0d3403f7e9ca 200 1ms
info:    ▪ <-- POST /assistants/search
info:    ▪ --> POST /assistants/search 200 2ms
info:    ▪ <-- GET /info
info:    ▪ --> GET /info 200 0ms
info:    ▪ <-- POST /assistants/search
info:    ▪ --> POST /assistants/search 200 0ms
info:    ▪ <-- GET /assistants/fe096781-5601-53d2-b2f6-0d3403f7e9ca/graph?xray=true
info:    ▪ --> GET /assistants/fe096781-5601-53d2-b2f6-0d3403f7e9ca/graph?xray=true 200 1ms
info:    ▪ <-- GET /assistants/fe096781-5601-53d2-b2f6-0d3403f7e9ca/subgraphs?recurse=true
info:    ▪ --> GET /assistants/fe096781-5601-53d2-b2f6-0d3403f7e9ca/subgraphs?recurse=true 200 0ms
---> repeat repeat repeat

Related issues :

Workaround / Fix

Add the following overrides in your package.json

  "overrides": {
    "zod": "3.25.67"
  }

System Info

running on mac

langgraph-platform-simple-agent@1.0.0 /Users/davydewaele/Projects/AgenticAI/nestjs-mcp/langgraph-platform-simple-agent
├── @langchain/community@0.3.49
├── @langchain/core@0.3.66
├── @langchain/langgraph-cli@0.0.51
├── @langchain/langgraph@0.3.11
├── @langchain/openai@0.6.3
├── @langchain/tavily@0.1.4
├── @types/node@24.1.0
├── ts-node-dev@2.0.0
└── typescript@5.8.3
Originally created by @ddewaele on GitHub (Jul 26, 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 You can find a sample repo with the issue here : https://github.com/ddewaele/langgraph-platform-simple-agent/tree/develop/new-langchain-tavily ```ts import {AIMessage, HumanMessage} from "@langchain/core/messages"; import { ChatOpenAI } from "@langchain/openai"; import { TavilySearch } from "@langchain/tavily"; // this one does not work. takes a long time or times out. // import { TavilySearchResults } from "@langchain/community/tools/tavily_search"; // Using this depcrecated community version does work because it does not use zod import { MessagesAnnotation, StateGraph } from "@langchain/langgraph"; import { ToolNode } from "@langchain/langgraph/prebuilt"; const tools = [new TavilySearch({ maxResults: 3 })]; async function callModel(state: typeof MessagesAnnotation.State) { const model = new ChatOpenAI({ model: "gpt-4o", }).bindTools(tools); const response = await model.invoke([ { role: "system", content: `You are a helpful assistant. The current date is ${new Date().getTime()}.`, }, ...state.messages, ]); return { messages: response }; } function routeModelOutput(state: typeof MessagesAnnotation.State) { const messages = state.messages; const lastMessage: AIMessage = messages[messages.length - 1]; if ((lastMessage?.tool_calls?.length ?? 0) > 0) { return "tools"; } return "__end__"; } const workflow = new StateGraph(MessagesAnnotation) .addNode("callModel", callModel) .addNode("tools", new ToolNode(tools)) .addEdge("__start__", "callModel") .addConditionalEdges( "callModel", routeModelOutput, ["tools", "__end__"] ) .addEdge("tools", "callModel"); export const graph = workflow.compile(); ``` ### Error Message and Stack Trace (if applicable) ``` base ❯ npm install npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead > langgraph-platform-simple-agent@1.0.0 prepare > npm run build > langgraph-platform-simple-agent@1.0.0 build > tsc src/agent.ts:14:19 - error TS2589: Type instantiation is excessively deep and possibly infinite. 14 const model = new ChatOpenAI({ ~~~~~~~~~~~~~~~~ 15 model: "gpt-4o", ~~~~~~~~~~~~~~~~~~~~~~~~ 16 }).bindTools(tools); ~~~~~~~~~~~~~~~~~~~~~~~ ``` and ``` info: ▪ --> GET /assistants/453d1cbf-0bdd-5d35-a224-394f372c0502/schemas 500 30s Error: Failed to extract schema for "assistant" at getCachedStaticGraphSchema (file:///Users/davydewaele/Projects/AgenticAI/nestjs-mcp/test-repo/node_modules/@langchain/langgraph-api/dist/graph/load.mjs:82:19) at async file:///Users/davydewaele/Projects/AgenticAI/nestjs-mcp/test-repo/node_modules/@langchain/langgraph-api/dist/api/assistants.mjs:138:33 at async file:///Users/davydewaele/Projects/AgenticAI/nestjs-mcp/test-repo/node_modules/@langchain/langgraph-api/dist/api/assistants.mjs:133:24 at async dispatch (file:///Users/davydewaele/Projects/AgenticAI/nestjs-mcp/test-repo/node_modules/hono/dist/compose.js:22:17) at async file:///Users/davydewaele/Projects/AgenticAI/nestjs-mcp/test-repo/node_modules/hono/dist/validator/validator.js:81:5 at async dispatch (file:///Users/davydewaele/Projects/AgenticAI/nestjs-mcp/test-repo/node_modules/hono/dist/compose.js:22:17) at async file:///Users/davydewaele/Projects/AgenticAI/nestjs-mcp/test-repo/node_modules/hono/dist/validator/validator.js:81:5 at async dispatch (file:///Users/davydewaele/Projects/AgenticAI/nestjs-mcp/test-repo/node_modules/hono/dist/compose.js:22:17) at async file:///Users/davydewaele/Projects/AgenticAI/nestjs-mcp/test-repo/node_modules/@langchain/langgraph-api/dist/http/middleware.mjs:51:9 at async dispatch (file:///Users/davydewaele/Projects/AgenticAI/nestjs-mcp/test-repo/node_modules/hono/dist/compose.js:22:17) { [cause]: Error: Schema extract worker timed out at Timeout._onTimeout (/Users/davydewaele/Projects/AgenticAI/nestjs-mcp/test-repo/node_modules/@langchain/langgraph-api/dist/graph/parser/index.mjs:23:24) ``` ### Description The langchainjs`"zod": "^3.25.32"` resolution means that the latest zod 3.x will be used in langgraphjs projects when langchainjs is used. At the time of writing this means that `3.25.76` is used. This causes 2 issues (that can be resolved by downgrading zod to `3.25.67`) - compilation failure during tsc - schema generation on langgraph / langgraph-cli dev takes a very long time (or times out) ## Running npm install The following happens when running npm install ``` base ❯ npm install npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead > langgraph-platform-simple-agent@1.0.0 prepare > npm run build > langgraph-platform-simple-agent@1.0.0 build > tsc src/agent.ts:14:19 - error TS2589: Type instantiation is excessively deep and possibly infinite. 14 const model = new ChatOpenAI({ ~~~~~~~~~~~~~~~~ 15 model: "gpt-4o", ~~~~~~~~~~~~~~~~~~~~~~~~ 16 }).bindTools(tools); ~~~~~~~~~~~~~~~~~~~~~~~ ``` ## Running npx @langchain/langgraph-cli dev This will take an extremely long time and most likely timout unless you run it on a super computer ``` base ❯ npx @langchain/langgraph-cli dev Welcome to ╦ ┌─┐┌┐┌┌─┐╔═╗┬─┐┌─┐┌─┐┬ ┬ ║ ├─┤││││ ┬║ ╦├┬┘├─┤├─┘├─┤ ╩═╝┴ ┴┘└┘└─┘╚═╝┴└─┴ ┴┴ ┴ ┴.js - 🚀 API: http://localhost:2024 - 🎨 Studio UI: https://smith.langchain.com/studio?baseUrl=http://localhost:2024 This in-memory server is designed for development and testing. For production use, please use LangGraph Cloud. info: ▪ Starting server... info: ▪ Initializing storage... info: ▪ Registering graphs from /Users/davydewaele/Projects/AgenticAI/nestjs-mcp/langgraph-platform-simple-agent info: ┏ Registering graph with id 'agent' info: ┗ [1] { graph_id: 'agent' } info: ▪ Starting 10 workers info: ▪ Server running at ::1:2024 info: ▪ <-- GET /assistants/fe096781-5601-53d2-b2f6-0d3403f7e9ca/schemas info: ▪ <-- GET /assistants/fe096781-5601-53d2-b2f6-0d3403f7e9ca info: ▪ --> GET /assistants/fe096781-5601-53d2-b2f6-0d3403f7e9ca 200 1ms info: ▪ <-- POST /assistants/search info: ▪ --> POST /assistants/search 200 2ms info: ▪ <-- GET /info info: ▪ --> GET /info 200 0ms info: ▪ <-- POST /assistants/search info: ▪ --> POST /assistants/search 200 0ms info: ▪ <-- GET /assistants/fe096781-5601-53d2-b2f6-0d3403f7e9ca/graph?xray=true info: ▪ --> GET /assistants/fe096781-5601-53d2-b2f6-0d3403f7e9ca/graph?xray=true 200 1ms info: ▪ <-- GET /assistants/fe096781-5601-53d2-b2f6-0d3403f7e9ca/subgraphs?recurse=true info: ▪ --> GET /assistants/fe096781-5601-53d2-b2f6-0d3403f7e9ca/subgraphs?recurse=true 200 0ms ---> repeat repeat repeat ``` ## Related issues : - https://github.com/langchain-ai/langgraphjs/issues/1383 - https://github.com/langchain-ai/langchainjs/issues/8468 ## Workaround / Fix Add the following overrides in your package.json ``` "overrides": { "zod": "3.25.67" } ``` ### System Info running on mac ``` langgraph-platform-simple-agent@1.0.0 /Users/davydewaele/Projects/AgenticAI/nestjs-mcp/langgraph-platform-simple-agent ├── @langchain/community@0.3.49 ├── @langchain/core@0.3.66 ├── @langchain/langgraph-cli@0.0.51 ├── @langchain/langgraph@0.3.11 ├── @langchain/openai@0.6.3 ├── @langchain/tavily@0.1.4 ├── @types/node@24.1.0 ├── ts-node-dev@2.0.0 └── typescript@5.8.3 ```
yindo added the buggood writeup labels 2026-02-15 18:15:49 -05:00
yindo closed this issue 2026-02-15 18:15:49 -05:00
Author
Owner

@malkhuzayyim commented on GitHub (Aug 5, 2025):

disclaimer: I'm very fresh to the langgraph ecosystem, coming from web dev land

I couldn't get rid of the extract schema error on langgraph-cli even by pinning the zod version like you suggested. Spent a number of hours trying to figure it out.

I was creating my own tool not using a prebuilt one, using a simple retrieval setup from cloudflare-autorag REST API.

I ended up trying to pass simple json schemas to the tool definitions, and they worked. Then I figured using the zod-to-json-schema package could help. And it did, but I had to clean up its output for some reason to bypass the errors, I believe it wasn't going to work without cleaning it up. The utility for cleaning it I am using now looks like this:

/* eslint-disable @typescript-eslint/no-explicit-any */
import type { z } from "zod";
import { zodToJsonSchema } from "zod-to-json-schema";

export function zodToToolSchema(zodSchema: z.ZodTypeAny): any {
  const jsonSchema = zodToJsonSchema(zodSchema, {
    $refStrategy: "none",
  });

  const cleanSchema = (obj: any): any => {
    if (typeof obj !== "object" || obj === null) {
      return obj;
    }

    if (Array.isArray(obj)) {
      return obj.map(cleanSchema);
    }

    const cleaned: any = {};
    for (const [key, value] of Object.entries(obj)) {
      if (key === "$schema") continue; // Remove JSON Schema meta property
      if (key === "additionalProperties" && value === false) continue; // Remove strict validation

      cleaned[key] = cleanSchema(value);
    }
    return cleaned;
  };

  return cleanSchema(jsonSchema);
}

And then using it in the tool definitions like so:

// ...
export const retrievalTool = tool(
  async (input) => {
    // validate input with Zod
    const { query } = retrievalSchema.parse(input);
    // ... retrieval logic
  },
  {
    name: "search_knowledge_base",
    description: `...`,
    schema: zodToToolSchema(retrievalSchema), // clean tool schema
  }
);

This seemed to work fine, finally was unblocked and was able to run the dev server and experiment with it. And I'm okay with it as a workaround. I'm not sure if I'm giving up something though by doing this instead of relying on the built in zod schema passing option, or if there are other issues I may run into down the road that may be real blockers for the path I'm going (which is all in on langgraph, including the deployment platform).

@malkhuzayyim commented on GitHub (Aug 5, 2025): disclaimer: I'm very fresh to the langgraph ecosystem, coming from web dev land I couldn't get rid of the extract schema error on langgraph-cli even by pinning the zod version like you suggested. Spent a number of hours trying to figure it out. I was creating my own tool not using a prebuilt one, using a simple retrieval setup from cloudflare-autorag REST API. I ended up trying to pass simple json schemas to the tool definitions, and they worked. Then I figured using the `zod-to-json-schema` package could help. And it did, but I had to clean up its output for some reason to bypass the errors, I believe it wasn't going to work without cleaning it up. The utility for cleaning it I am using now looks like this: ```ts /* eslint-disable @typescript-eslint/no-explicit-any */ import type { z } from "zod"; import { zodToJsonSchema } from "zod-to-json-schema"; export function zodToToolSchema(zodSchema: z.ZodTypeAny): any { const jsonSchema = zodToJsonSchema(zodSchema, { $refStrategy: "none", }); const cleanSchema = (obj: any): any => { if (typeof obj !== "object" || obj === null) { return obj; } if (Array.isArray(obj)) { return obj.map(cleanSchema); } const cleaned: any = {}; for (const [key, value] of Object.entries(obj)) { if (key === "$schema") continue; // Remove JSON Schema meta property if (key === "additionalProperties" && value === false) continue; // Remove strict validation cleaned[key] = cleanSchema(value); } return cleaned; }; return cleanSchema(jsonSchema); } ``` And then using it in the tool definitions like so: ```ts // ... export const retrievalTool = tool( async (input) => { // validate input with Zod const { query } = retrievalSchema.parse(input); // ... retrieval logic }, { name: "search_knowledge_base", description: `...`, schema: zodToToolSchema(retrievalSchema), // clean tool schema } ); ``` This seemed to work fine, finally was unblocked and was able to run the dev server and experiment with it. And I'm okay with it as a workaround. I'm not sure if I'm giving up something though by doing this instead of relying on the built in zod schema passing option, or if there are other issues I may run into down the road that may be real blockers for the path I'm going (which is all in on langgraph, including the deployment platform).
Author
Owner

@ddewaele commented on GitHub (Aug 6, 2025):

@malkhuzayyim are you using yarn or npn ? yarn uses resolutions and npm uses overrides in package.json.

@ddewaele commented on GitHub (Aug 6, 2025): @malkhuzayyim are you using yarn or npn ? yarn uses `resolutions` and npm uses `overrides` in package.json.
Author
Owner

@malkhuzayyim commented on GitHub (Aug 6, 2025):

Using pnpm, my setup is part of a larger monorepo, and i pinned the zod version with pnpm overrides which I'm familiar with, i can clearly see the effect of the overrides in the lockfile.

The thing is though, langgraph-cli has been releasing a version nearly everyday for the last month or two from what i saw from the release history. And its unclear what the releases are changing i couldn't find much info. The last release was less than 12 hours ago. Perhaps something else changed since the zod version pin was a viable workaround? Or my langgraph pkg's are different enough from yours to not work with it.

@malkhuzayyim commented on GitHub (Aug 6, 2025): Using pnpm, my setup is part of a larger monorepo, and i pinned the zod version with pnpm overrides which I'm familiar with, i can clearly see the effect of the overrides in the lockfile. The thing is though, langgraph-cli has been releasing a version nearly everyday for the last month or two from what i saw from the release history. And its unclear what the releases are changing i couldn't find much info. The last release was less than 12 hours ago. Perhaps something else changed since the zod version pin was a viable workaround? Or my langgraph pkg's are different enough from yours to not work with it.
Author
Owner

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

Hello! We do see that Zod 3.25.68+ is causing the dreaded Type instantiation is excessively deep and possibly infinite. Will investigate further to determine the root cause.

For now would recommend adding a resolutions / overrides field in your package.json, pinning zod to 3.25.67`

@dqbd commented on GitHub (Aug 6, 2025): Hello! We do see that Zod 3.25.68+ is causing the dreaded Type instantiation is excessively deep and possibly infinite. Will investigate further to determine the root cause. For now would recommend adding a `resolutions` / `overrides` field in your `package.json`, pinning `zod` to 3.25.67`
Author
Owner

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

Please try upgrading @langchain/tavily to 0.1.5, which should resolve the issue.

@dqbd commented on GitHub (Aug 6, 2025): Please try upgrading `@langchain/tavily` to 0.1.5, which should resolve the issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#315