There are multiple type errors in my generated schema file TaskCreateOrConnectWithoutSubtasksInput.schema.ts.
I think that this error occurs because this is a self-reference.
❯ npm run build
> foo@0.1.0 build
> next build
- info Linting and checking validity of types ..Failed to compile.
./prisma/generated/schemas/objects/TaskCreateOrConnectWithoutSubtasksInput.schema.ts:8:7
Type error: Type 'ZodObject<{ where: ZodLazy<ZodType<TaskWhereUniqueInput, ZodTypeDef, TaskWhereUniqueInput>>; create: ZodUnion<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>' is not assignable to type 'ZodType<TaskCreateOrConnectWithoutSubtasksInput, ZodTypeDef, TaskCreateOrConnectWithoutSubtasksInput>'.
The types of '_type.create' are incompatible between these types.
Type '(TaskCreateWithoutSubtasksInput | TaskUncheckedCreateWithoutSubtasksInput) & (TaskCreateWithoutSubtasksInput | TaskUncheckedCreateWithoutSubtasksInput | undefined)' is not assignable to type '(Without<TaskCreateWithoutSubtasksInput, TaskUncheckedCreateWithoutSubtasksInput> & TaskUncheckedCreateWithoutSubtasksInput) | (Without<...> & TaskCreateWithoutSubtasksInput)'.
Type 'TaskCreateWithoutSubtasksInput & TaskUncheckedCreateWithoutSubtasksInput' is not assignable to type '(Without<TaskCreateWithoutSubtasksInput, TaskUncheckedCreateWithoutSubtasksInput> & TaskUncheckedCreateWithoutSubtasksInput) | (Without<...> & TaskCreateWithoutSubtasksInput)'.
Type 'TaskCreateWithoutSubtasksInput & TaskUncheckedCreateWithoutSubtasksInput' is not assignable to type 'Without<TaskUncheckedCreateWithoutSubtasksInput, TaskCreateWithoutSubtasksInput> & TaskCreateWithoutSubtasksInput'.
Type 'TaskCreateWithoutSubtasksInput & TaskUncheckedCreateWithoutSubtasksInput' is not assignable to type 'Without<TaskUncheckedCreateWithoutSubtasksInput, TaskCreateWithoutSubtasksInput>'.
Types of property 'userId' are incompatible.
Type 'string' is not assignable to type 'undefined'.
6 | import type { Prisma } from '@prisma/client'
7 |
> 8 | const Schema: z.ZodType<Prisma.TaskCreateOrConnectWithoutSubtasksInput> =
| ^
9 | z
10 | .object({
11 | where: z.lazy(() => TaskWhereUniqueInputObjectSchema),
How to reproduce
I am not sure. I can help if someone give me any instruction.
Bug description
There are multiple type errors in my generated schema file
TaskCreateOrConnectWithoutSubtasksInput.schema.ts
.I think that this error occurs because this is a self-reference.
How to reproduce
I am not sure. I can help if someone give me any instruction.
Expected behavior
No response
Prisma information
Environment & setup
Prisma Version