[BUG] Prisma 6.6.0 incompatibility
Describe the bug I'm trying to use the zod generator but it's failing on 6.6.0.
Screenshots
Package versions (please complete the following information):
- zod: 3.2.4
- prisma: 6.6.0
Additional context
Prisma 6.7 is fine
@zcvaters Just tested with Prisma 6.7, the issue persists
Try switching back to the prisma-client-js generator instead of the new prisma-client generator.
Any solution that doesn't involve switching back?
Anyone else having this problem -- added this script to our build process right after npx prisma generate, hopefully it won't be necessary for too much longer...
# this is only necessary because the zod schema generator has a bug that will soon be patched
sed "s/Prisma.NullTypes.DbNull | Prisma.NullTypes.JsonNull/typeof Prisma.NullTypes.DbNull | typeof Prisma.NullTypes.JsonNull/" prisma/generated/zod/index.ts > __tmpzod.ts && mv __tmpzod.ts prisma/generated/zod/index.ts
echo "Patched generated zod schema -- check if it's been fixed! https://github.com/chrishoermann/zod-prisma-types/issues/335"
Me too. I need to use the prisma-client in order to have the native typescript client
If you’re blocked by Prisma 6.x / the new prisma-client generator here, consider Prisma Zod Generator (actively maintained). It supports the new client generator and Zod 4, so you don’t need to switch back to prisma-client-js.
Highlights:
- Prisma 6 + new
prisma-clientgenerator support - Zod 4 compatibility
- Models-only and single-file output modes for minimal footprints
- Dual exports (typed ZodObject + pure Zod), schema variants
- Unified configuration system with auto-discovery and recipes (unique here)
- Active releases (latest: v1.4.2)
Repo/Docs: https://github.com/omar-dulaimi/prisma-zod-generator Changelog: https://github.com/omar-dulaimi/prisma-zod-generator/blob/master/CHANGELOG.md Issues/Feature requests/PRs welcome: https://github.com/omar-dulaimi/prisma-zod-generator/issues
@omar-dulaimi can you explain how to make it work with the new generator? by default it imports everything from @prisma/client, which isn't meant to be used with the new generator (in favor of importing client types directly from ./prisma/generated)
@omar-dulaimi can you explain how to make it work with the new generator? by default it imports everything from
@prisma/client, which isn't meant to be used with the new generator (in favor of importing client types directly from./prisma/generated)
You just need to update to latest version, and use the new client in your prisma schema. Don't forget to set output path, it's become required.
Generator will handle the rest itself in terms of using the right paths.