ZodResolver schema types Error #10861
Replies: 5 comments 8 replies
-
Have you been able to solve it? or do you just use npm or yarn? |
Beta Was this translation helpful? Give feedback.
-
What versions of Do you have a project example / codesandbox to try? |
Beta Was this translation helpful? Give feedback.
-
Well I was able to solve it. I just tried again and again to change zod version in all files and pnpm install until it worked... |
Beta Was this translation helpful? Give feedback.
-
I just changed from I could not be the best solution obviously, but, to my case, this was good enough |
Beta Was this translation helpful? Give feedback.
-
In case anyone else runs into a similar problem with Before export const mySchema = z.object({
price: z.coerce().z.number().min(1, "Please enter your price.")),
}); After export const mySchema = z.object({
price: z.transform(Number).pipe(z.number().min(1, "Please enter your price.")),
}); This issue should shed more light: colinhacks/zod#3769 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have an error on my useForm() with zodResolver : Argument of type 'ZodObject<{ name: ZodString; imageUrl: ZodString; }, "strip", ZodTypeAny, { name: string; imageUrl: string; }, { name: string; imageUrl: string; }>' is not assignable to parameter of type 'ZodType<any, any, any>'. The types of 'refine(...)._def.typeName' are incompatible between these types.
I am using pnpm and I've seen people sayin that it's a problem with zod version in pnpm monorepo but I can't seem to find the fix. Can someone help me please ?
Beta Was this translation helpful? Give feedback.
All reactions