Cannot find module '@langchain/langgraph/zod'

getting this error, with the following versions:
{
@langchain/core”: “^1.1.0”,
@langchain/langgraph”: “^1.0.2”,
“langchain”: “1.1.1”,
“zod”: “4.1.0”
}

then the register() method do not work in zod

the latest doc suggests this code: Quickstart - Docs by LangChain

I also tried downgrading zod to 3.25.32, then the register() method from zod do not work.

should I use Annotation API instead or there is a suggested fix for that?

hi @shawon-majid

add tsconfig.json file in the root of your project with this content:

{
  "compilerOptions": {
    "target": "ES2022",
    "module": "NodeNext",
    "moduleResolution": "nodenext",
    "strict": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "types": ["node"]
  },
  "include": ["src/**/*.ts"]
}

Make sure “include” points to the correct source directory where your sources are placed.

Huge favor: If this helps, please mark the post as solved so it serves others :slight_smile: Thanks in advance :slight_smile:

1 Like