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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃悶Yup] TypeScript error in unit-test wrapper after upgrading to v3.3.1 #626

Open
xsjcTony opened this issue Aug 29, 2023 · 6 comments

Comments

@xsjcTony
Copy link

xsjcTony commented Aug 29, 2023

Describe the bug
Hey, the Type error happened after upgrading to v3.3.1, and I'm using generic to create a wrapper with react-hook-form in my unit test.
It's a regression since it's working well in v3.3.0.

I raised a similar issue last time but it ended up saying it's not a hookform/resolver issue and being transformed into the discussion, but it ACTUALLY IS. It's fixed in several releases after, but this time it's a different issue and I'm pretty sure it's because of the last release v3.3.0 -> v3.3.1
For reference: https://github.com/orgs/react-hook-form/discussions/10160

To Reproduce
Open link below

Codesandbox link (Required)
https://stackblitz.com/edit/vitejs-vite-zkuudx?file=src%2F__tests__%2FDemo.test.tsx

Expected behaviour
A clear and concise description of what you expected to happen.

Screenshots
image

Desktop (please complete the following information):

OS: Windows 11
Browser: Chrome
Version: 116

@nachodevify
Copy link

did you find any workaround?

@willd-mwp
Copy link

@jorisre

Is there a possibility of yourself or one of the other regular maintainers investigating this bug. we've also encountered it an have had to keep our @hookform/resolvers version on 3.3.0 instead of upgrading to 3.3.1`

@Kizmar
Copy link

Kizmar commented Sep 26, 2023

Same here. We were on 3.2.0 and upgraded straight to 3.3.1 and ran into the same error. Reverted to 3.3.0 and it's working again.

@xsjcTony xsjcTony changed the title [Yup] TypeScript error in unit-test wrapper after upgrading to v3.3.1 [馃悶Yup] TypeScript error in unit-test wrapper after upgrading to v3.3.1 Oct 12, 2023
@crow7m
Copy link

crow7m commented Oct 12, 2023

same here, after a minor version update, getting an error that the schema wont match, before, we didn have to specify the types for the resolver function where there are conditional or non-required fields, after rollback to 3.0.0, it works fine
any ideas here

@JohannesFeige
Copy link

any updates here?

@Kizmar
Copy link

Kizmar commented Nov 21, 2023

In our case, it was an issue with one of the validators using Yup.string() on a property that was marked as "any". Once we changed the "any" property to a "string", the error went away.

That scenario worked in prior versions, and didn't otherwise throw any errors or warnings that we noticed. The "any" type was old in this case, should have been a "string" anyway. So we lucked out.

Seems like the OP issue may be specific to using generics.

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

6 participants