Skip to content

Unable to use Zod v4 in AI SDK #10014

@lockieluke

Description

@lockieluke

Description

Image

Error goes away when I switch back to zod@3.25.76, this happens with any schema used in generateObject

Image

AI SDK Version

  • ai: 5.0.86
  • zod: 4.1.12
  • @openrouter/ai-sdk-provider: 1.1.0(Also tried replacing this with @ai-sdk/openai-compatible, unfortunately had no luck)

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions