Skip to content

Support for Zod 4 #297

@jtmueller

Description

@jtmueller

I would love to see a version that's compatible with Zod 4. It's currently the only thing preventing me from upgrading Zod in my project, and I'd very much like to upgrade Zod to take advantage of the dramatic performance and bundle-size improvements.

If I try to update to Zod 4, every single call to zodForm raises TypeScript errors such as:

error TS2345: Argument of type 'ZodObject<{ email: ZodString; password: ZodString; }, $strip>' is not assignable to parameter of type 'ZodType<any, any, FieldValues>'.
  Types of property 'def' are incompatible.
    Type '$ZodObjectDef<{ email: ZodString; password: ZodString; }>' is not assignable to type 'FieldValues | FieldValue | (FieldValues | FieldValue)[]'.
      Type '$ZodObjectDef<{ email: ZodString; password: ZodString; }>' is not assignable to type 'FieldValues'.
        Index signature for type 'string' is missing in type '$ZodObjectDef<{ email: ZodString; password: ZodString; }>'.

93     validate: zodForm(LoginVerificationSchema),

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions