@conform-to/zod@1.8.2 is not compatible with zod@4.0.14 #993
-
When I integrated @conform-to/zod with zod, I encountered critical errors such as: and received: This suggests that @conform-to/zod should be compatible with both Zod v3.21.x and v4.x. However, when using zod@4.0.14, it throws serious runtime errors and breaks the application. Rolling back to zod@3.21.x resolves the issue. Additionally, the following error also occurs: Is this a compatibility issue with @conform-to/zod v1.8.2? Or is there any specific Zod v4.x version known to work? Kindly help clarify. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is a compatibility issue caused by the import path. The default import ( To use Zod v4.x (including v4.0.14), you must import from import { parseWithZod } from '@conform-to/zod/v4'; There is no Zod v4.x version that will work with the default Written by @dosu, approved by chimame To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
This is a compatibility issue caused by the import path. The default import (
@conform-to/zod
) is only for Zod v3.x and expects exports likeZodPipeline
andZodBranded
, which do not exist in Zod v4.x. That’s why you see those runtime errors with Zod v4.x.To use Zod v4.x (including v4.0.14), you must import from
@conform-to/zod/v4
instead. For example:There is no Zod v4.x version that will work with the default
@conform-to/zod
import; you always need to use the/v4
entrypoint with Zod v4.x. This usage is confirmed in both the documentation and issue threads (example).Written by @dosu, approved by chimame
To reply, just mention @dosu.
H…