resolvers icon indicating copy to clipboard operation
resolvers copied to clipboard

errors object creating circular structure with yup resolver

Open brianbattenfeld opened this issue 1 year ago • 0 comments

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:

  1. Go to the codesandbox https://6x7zpv.csb.app/ (which is a fork of the example found here, with only the JSON.stringify() added)
  2. Fill out no inputs and submit to force an error to be created
  3. 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 Screenshot 2024-01-24 at 5 36 23 PM Screenshot 2024-01-24 at 5 37 04 PM

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.

brianbattenfeld avatar Jan 24 '24 22:01 brianbattenfeld