Skip to content

Using useFieldArray, shouldUseNativeValidation: true and joiResolver together causes a bug #692

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

Closed
ZzzZeta opened this issue Jun 13, 2024 · 1 comment · Fixed by #734
Closed
Labels
next release Marks issues or PRs planned for the upcoming version. released

Comments

@ZzzZeta
Copy link

ZzzZeta commented Jun 13, 2024

Describe the bug

TypeError: Cannot read properties of undefined (reading 'refs')

    at i (https://hdv5hj.csb.app/node_modules/
hookform/resolvers/dist/resolvers.js:1:357
    at Object.t [as validateFieldsNatively] (https://hdv5hj.csb.app/node_modules/
hookform/resolvers/dist/resolvers.js:1:431
    at u (https://hdv5hj.csb.app/node_modules/
hookform/resolvers/joi/dist/joi.js:1:688
async Object.R [as _executeSchema]
https://hdv5hj.csb.app/node_modules/react-hook-form/dist/index.cjs.js:1:14139

} else if (field.refs) {

field is undefined here.

To Reproduce
Steps to reproduce the behavior:

  1. Click on 'APPEND'
  2. Click on 'SUBMIT QUERY'
  3. Click on 'APPEND'
  4. See error

Codesandbox link (Required)
https://codesandbox.io/p/sandbox/react-hook-form-joiresolver-hdv5hj

Expected behavior
The error should not happen.

Screenshots

Desktop (please complete the following information):

  • OS: Windows
  • Browser
    • Chrome 126.0.6478.57
    • Edge 125.0.2535.92
    • Firefox 127.0

Smartphone (please complete the following information):

  • Device: Samsung Galaxy
  • OS: Android 14
  • Browser
    • Firefox 126.0.1

Additional context
None.

@jorisre jorisre added the next release Marks issues or PRs planned for the upcoming version. label Jan 28, 2025
Copy link
Contributor

🎉 This issue has been resolved in version 4.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next release Marks issues or PRs planned for the upcoming version. released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants