Skip to content

Zid can't be in a z.array #793

@pupeno

Description

@pupeno

The Zid type of the Zod helpers doesn't seem to implement whatever is necessary to be able to belong to a z.array.

The specific error I'm getting is:

lib/validation/competitions.ts:23:21 - error TS2345: Argument of type 'Zid<"genres">' is not assignable to parameter of type 'SomeType'.
  Property '_zod' is missing in type 'Zid<"genres">' but required in type 'SomeType'.

23   genreIds: z.array(zid("genres")),
                       ~~~~~~~~~~~~~

  node_modules/zod/v4/core/schemas.d.cts:86:5
    86     _zod: _$ZodTypeInternals;
           ~~~~
    '_zod' is declared here.

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