Skip to content

RangeError: Maximum call stack size exceeded #2

@kracas

Description

@kracas

I'm getting RangeError: Maximum call stack size exceeded error when converting a schema that has:

  • .or(z.undefined())
  • .or(z.null())
  • z.any()

For example:

const schema1 = z.string().or(z.undefined());

const schema2 = z.number().or(z.null());

const schema3 = z.object({
  foo: z.string().or(z.undefined()),
});

const schema4 = z.any();

const schema5 = z.object({
  bar: z.any(),
});

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