superRefine don't work #3296
-
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Here is a much simpler example: const schema = z.object( {
foo: z.string()
} ).superRefine( ( values, ctx ) => {
console.log( 'superRefine', values )
// never gets called
} )
const result = schema.safeParse( {} )
!result.success && console.log( result.error.issues )
// [
// {
// code: "invalid_type",
// expected: "string",
// received: "undefined",
// path: [ "foo" ],
// message: "Required",
// }
// ] Not sure if this is a bug or intended behavior |
Beta Was this translation helpful? Give feedback.
-
Why did you close this? |
Beta Was this translation helpful? Give feedback.
-
Try this:
|
Beta Was this translation helpful? Give feedback.
-
work for me:
|
Beta Was this translation helpful? Give feedback.
Here is a much simpler example:
Not sure if this is a bug or intended behavior