Skip to content

failure to add HTMLInputElement to indexDB and json.stringify with circular structure errors with form on.submit() via react-hook-form #1228

@ty-kerr

Description

@ty-kerr

Upon submitting a form with react-hook-form ran into the following errors with segment/analytics-next.

Image Image

it seems like there is an issue trying to clone a html input element into indexdb (first error), then json.stringify is called on a object with circular reference throwing the second error. I noticed that these two errors always occurs together, and never alone by each other so they could be somewhat related to each other.

Another interesting note, the type of my form when this error occurs is

export type FormFields = {
  name: string;
  type: string[];
};

But changing the type as shown below seems to prevent the errors from occuring.

export type FormFields = {
  test_name: string;
  test_type: string[];
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions