Skip to content

The starter doesn't declare zod, so void gen model reports no validation library #505

Closed

Description

@ashunar0

The starter's pages/index.server.ts uses createInsertSchema from void/drizzle-zod (cli/template.ts:237), but the generated package.json has no zod. The starter works because pnpm fills drizzle-zod's zod peer with the copy other dependencies install (better-auth, @cloudflare/config). The app itself never declares zod.

void gen model detects the validation library from package.json only (cli/gen.ts:168-180), so even right after create it asks "No validation library detected". Choosing Zod doesn't add it to package.json; it only prints Remember to install zod (:206). The generated code imports zod directly, so type checking fails as is:

routes/api/todos/index.ts(1,19): error TS2307: Cannot find module 'zod'

To reproduce:

pnpm create void my-app   # React / D1
cd my-app
pnpm exec void gen model todos title:string done:boolean   # choose Zod
pnpm exec tsc --noEmit

Proposal: let void init ask for the validation library (Zod / Valibot / ArkType), add it to package.json, and write the starter's index.server.ts with the matching void/drizzle-*. The starter and gen then assume the same library from the start. With Zod as the default, pressing Enter keeps today's flow. Like #495, it would also get a --validator flag.

If this direction works for you, I'll open a PR on top of #495.

The smallest fix would be adding zod to the starter's package.json, which also fixes the detection and the type error.

Activity

  1. self-assigned this
    on Oct 20, 2026
  2. added a commit that references this issue on Oct 20, 2026
    6b6c611
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions