Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typeerror when used with zod 3.23 #675

Open
ljukas opened this issue May 3, 2024 · 1 comment
Open

Typeerror when used with zod 3.23 #675

ljukas opened this issue May 3, 2024 · 1 comment

Comments

@ljukas
Copy link

ljukas commented May 3, 2024

Describe the bug
When used together with zod 3.23 it will throw type errors in the zodResolver() function, all schemas does this

To Reproduce
Use latest release of @hookform/resolvers with zod 3.23

Expected behavior
To work with zod 3.23

@nkovacic
Copy link

nkovacic commented May 13, 2024

After updating to zod 3.23.8 this issue started appearing for me.
Updating @hookform/resolvers to 3.3.4 does not help.

TypeScript error message:

Argument of type 'ZodObject<{ email: ZodString; }, "strip", ZodTypeAny, { email: string; }, { email: string; }>' is not assignable to parameter of type 'ZodType<any, any, any>'.
  The types of '_getOrReturnCtx(...).common.issues' are incompatible between these types.
    Type 'Zod.ZodIssue[]' is not assignable to type 'import("/web/node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/ZodError").ZodIssue[]'.
      Type 'Zod.ZodIssue' is not assignable to type 'import("/web/node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/ZodError").ZodIssue'.
        Type 'ZodInvalidUnionIssue & { fatal?: boolean | undefined; message: string; }' is not assignable to type 'ZodIssue'.
          Type 'Zod.ZodInvalidUnionIssue & { fatal?: boolean | undefined; message: string; }' is not assignable to type 'import("/web/node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/ZodError").ZodInvalidUnionIssue & { fatal?: boolean | undefined; message: string; }'.
            Type 'ZodInvalidUnionIssue & { fatal?: boolean | undefined; message: string; }' is not assignable to type 'ZodInvalidUnionIssue'.
              Types of property 'unionErrors' are incompatible.
                Type 'Zod.ZodError<any>[]' is not assignable to type 'import("/web/node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/ZodError").ZodError<any>[]'.
                  Type 'Zod.ZodError<any>' is not assignable to type 'import("/web/node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/ZodError").ZodError<any>'.
                    Types of property 'issues' are incompatible.
                      Type 'Zod.ZodIssue[]' is not assignable to type 'import("/web/node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/ZodError").ZodIssue[]'.
                        Type 'Zod.ZodIssue' is not assignable to type 'import("/web/node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/ZodError").ZodIssue'.
                          Type 'ZodInvalidArgumentsIssue & { fatal?: boolean | undefined; message: string; }' is not assignable to type 'ZodIssue'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants