Skip to content

onServerValidate doesn't work with Zod in NextJs #1609

Closed

Description

@heinsenberg82

Describe the bug

onServerValidate doesn't seem to work properly with Zod schemas.
Instead of populating the form with error messages, the form is receiving entire objects. Here's a link that reproduces the issue: https://stackblitz.com/edit/tanstack-form-3wvkfapn?file=src%2Fapp%2Faction.ts

Your minimal, reproducible example

https://stackblitz.com/edit/tanstack-form-3wvkfapn?file=src%2Fapp%2Faction.ts

Steps to reproduce

Go to link to reproduce the issue. Try to enter a number like '9'.

Expected behavior

Form should be populated with error messages, not zod error objects.

How often does this bug happen?

None

Screenshots or Videos

No response

Platform

Windows 11

TanStack Form adapter

None

TanStack Form version

1.14.1

TypeScript version

No response

Additional context

No response

Activity

  1. heinsenberg82 commented on Jul 9, 2025

    @heinsenberg82
    Author

    Based on this (https://github.com/TanStack/form/releases/tag/v0.43.0), I made another fork following (I think) the instructions there, but still not working: https://stackblitz.com/edit/tanstack-form-q5ym4nkq?file=src%2Fapp%2Fclient-component.tsx

  2. crutchcorn commented on Jan 30, 2026

    @crutchcorn
    Contributor

    Can you retest with:

    npm i https://pkg.pr.new/@tanstack/react-form-nextjs@1890
    

    I believe we have a fix for many (if not all) Form SSR behaviors

  3. crutchcorn commented on Feb 13, 2026

    @crutchcorn
    Contributor

    Should be fixed in 1.28.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions