I'm trying to define an schema for an input, but I'm getting the following error:
Argument of type 'ZodNumber' is not assignable to parameter of type 'ZodType<any, ZodTypeDef, any>'.
The types of '_def.errorMap' are incompatible between these types.
Type 'import("c:/Users/<redacted>/node_modules/zod/lib/ZodError").ZodErrorMap' is not assignable to type 'Zod.ZodErrorMap'.
This happens because nodl has zod version "^3.20.2" set as a dependency, and I'm using "^3.21.4" in my project.
Not a big problem, I can go back to 3.20.2, but I think this can be fixed by defining zod as a peer dependency in nodl.
(At least I'm pretty sure this is the problem & solution lol)
edit:
I'm using yarn btw.
And actually, even if I set my zod dependency to "^3.20.2", yarn of course installs 3.21.4. So I gotta be explicit there.
Do you know why yarn installs 3.20.2 as dependency for nodl, but 3.21.4 for my own dependency? Shouldn't it resolve those to the same version, if both say "^...."?
I'm trying to define an schema for an input, but I'm getting the following error:
This happens because nodl has zod version "^3.20.2" set as a dependency, and I'm using "^3.21.4" in my project. Not a big problem, I can go back to 3.20.2, but I think this can be fixed by defining zod as a peer dependency in nodl. (At least I'm pretty sure this is the problem & solution lol)
edit: I'm using yarn btw. And actually, even if I set my zod dependency to "^3.20.2", yarn of course installs 3.21.4. So I gotta be explicit there.
Do you know why yarn installs 3.20.2 as dependency for nodl, but 3.21.4 for my own dependency? Shouldn't it resolve those to the same version, if both say "^...."?