You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a situation where I want to use a recursive type inside discriminated union type.
It results into this error:
Argument of type '[ZodObject<{ type: ZodLiteral<"a">; a: ZodString; }, "strip", ZodTypeAny, { type: "a"; a: string; }, { type: "a"
; a: string; }>, ZodObject<{ type: ZodLiteral<...>; b: ZodString; }, "strip", ZodTypeAny, { ...; }, { ...; }>, ZodType<...>]' is n
ot assignable to parameter of type '[ZodDiscriminatedUnionOption<"type", Primitive>, ZodDiscriminatedUnionOption<"type", Primitive
>, ...ZodDiscriminatedUnionOption<...>[]]'.
Type at position 2 in source is not compatible with type at position 2 in target.
Type 'ZodType<Category, ZodTypeDef, Category>' is missing the following properties from type 'ZodObject<{ type: ZodLiteral<Pri
mitive>; } & ZodRawShape, any, any, { [x: string]: any; }, { [x: string]: any; }>': _cached, _getCached, shape, strict, and 14 mor
e.
There seems to be a conflict between ZodType and ZodDiscriminatedUnionOption.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I have a situation where I want to use a recursive type inside discriminated union type.
It results into this error:
There seems to be a conflict between
ZodType
andZodDiscriminatedUnionOption
.Here the example I used:
The text was updated successfully, but these errors were encountered: