TanStack / TanStack/router

Can't use zod v4

Open
#6,138 8 comments 12 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
15.1k
Forks
1.9k
Avg merge
1d 20h
Merged PRs (30d)
143

Description

Which project does this relate to?

Start

Describe the bug

If I try to use zod 4 in project I get errors when starting vite because router-generator and start-core relies on zod v3 api', the old z.function().returns, its now z.function({input: [], output:[]}).

Your Example Website or App

https://stackblitz.com/edit/github-9eq11eyj?file=package.json

Steps to Reproduce the Bug or Issue

npm install
npm run dev

Expected behavior

Server should start

Screenshots or Videos
Image
Platform
  • Router / Start Version: latest
  • OS: macos
  • Browser: all
  • Browser Version: latest
  • Bundler: vite
  • Bundler Version: vite 7 and 8 beta
Additional context

I guess it's not possible to use zod v4 yet? otherwise get into weird issues where theres multiple versions of zod installed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the linked StackBlitz project using npm install and npm run dev, then inspect the zod usage in router-generator and start-core. Done means the server starts with zod v4 without the reported API errors or problematic duplicate zod installations.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.