Support Zod v4.0 #350
Closed
RobertWadeSteele
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
Hey, I just tried using Zod 4 with next-safe-action v8 (beta), and it seems to work perfectly. Since v8 relies on Standard Schema, there should be no issues using Zod 4 or any other validation library it supports. You can install next-safe-action v8 beta with: npm i next-safe-action@beta And here are the beta docs. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Zod 4.0 is coming soon. I imagine this is already on @TheEdoRan radar but I don't see an issue yet so figured I would make this.
The beta is out now but on installing it I see type errors with the safe action client indicating a potentially infinite type definition. I also saw runtime issues with the safe actions but haven't investigated exact details/causes. I can do more research in my off time but support for Zod v4.0 would be greatly appreciated.
I'm wondering what pitfalls might come up in supporting this. I'm not sure if/how it is possible to support Zod v3.0 and v4.0 at the same time. If it's not possible to support both would you be open to including this in the next major version of next safe actions? I see an open PR for version 8 and don't know what you have planned for that release but if support for v4 could come in that release that would be fantastic. Let me know if you want help and what I can do if so and I will do my best.
https://v4.zod.dev/v4
Beta Was this translation helpful? Give feedback.
All reactions