-
Notifications
You must be signed in to change notification settings - Fork 143
Open
Description
Describe the bug and the expected behavior
When wrapping a Zod schema with coerceFormValue(), the returned schema loses the superRefine method, causing a runtime error: TypeError: RecordPaymentSchema.superRefine is not a function
Conform version
v1.13.3
Steps to Reproduce the Bug or Issue
Define a Zod schema and wrap it with coerceFormValue:
import { coerceFormValue } from '@conform-to/zod/v4/future'
const RecordPaymentSchema = coerceFormValue(z.object({ /* fields */ }))
Try to call .superRefine() on the wrapped schema in the action:
const submission = await parseWithZod(formData, {
schema: RecordPaymentSchema.superRefine(async (data, ctx) => { /* ... */ }),
async: true,
})
Expected Behavior
The schema should support .superRefine() method for adding validation logic, as it does with unwrapped Zod schemas.
Actual Behavior
Runtime error: TypeError: RecordPaymentSchema.superRefine is not a function
What browsers are you seeing the problem on?
No response
Screenshots or Videos
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels