resolvers
resolvers copied to clipboard
errors object creating circular structure with yup resolver
Describe the bug When trying to stringify my errors object, I'm receiving a TypeError Converting circular structure to JSON
To Reproduce Steps to reproduce the behavior:
- Go to the codesandbox https://6x7zpv.csb.app/ (which is a fork of the example found here, with only the JSON.stringify() added)
- Fill out no inputs and submit to force an error to be created
- See TypeError surfaced in browser
Codesandbox link (Required)
Expected behavior I'd expect to see the errors object displayed as a string above the form
Screenshots
Desktop (please complete the following information):
- OS: OSX ventura
- Browser: chrome
- Version 119.0.6045.159
Additional context Stringifying errors (as well as the rest of the formState) is often useful for me and my team to be able to quickly reference within the UI in dev environments to troubleshoot.