Skip to content

$ZodPipe: Type instantiation is excessively deep #4611

@lo1tuma

Description

@lo1tuma

I’m using 3.25.50 and get a Type instantiation is excessively deep and possibly infinite. error when defining a recursive type using $ZodPipe.

type Foo = $ZodPipe<Bar, $ZodTransform>; // Type instantiation is excessively deep and possibly infinite.
type Bar = $ZodString | Foo;

with other zod types this works fine, e.g. with $ZodArray

type Foo2 = $ZodArray<Bar2>; // no error
type Bar2 = $ZodString | Foo2;

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions