WaspW
Wasp15mo ago
NEROX

SDK build failed with exit code: 2

Heyy @kapa.ai !

[ Wasp ] ext-src/dashboard/routines/EditRoutineModal.tsx(88,68): error TS2352: Conversion of type 'string' to type 'Set<string>' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. [ Wasp ] ext-src/dashboard/routines/RoutineForm.tsx(61,87): error TS2352: Conversion of type 'string' to type 'Set<string>' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. [ Wasp ] ext-src/dashboard/routines/RoutinesPage.tsx(36,15): error TS2322: Type '(GetResult<{ id: number; name: string; userId: string; }, unknown> & {})[]' is not assignable to type 'RoutineWithExercises[]'. [ Wasp ] Property 'exercises' is missing in type 'GetResult<{ id: number; name: string; userId: string; }, unknown> & {}' but required in type 'RoutineWithExercises'.

My main.wasp:

// Routine Queries query getRoutines { fn: import { getRoutines } from "@src/dashboard/routines/RoutineQueries", entities: [Routine, Exercise] } // Routine Actions action createRoutine { fn: import { createRoutine } from "@src/dashboard/routines/RoutineActions", entities: [Routine, Exercise] } action updateRoutine { fn: import { updateRoutine } from "@src/dashboard/routines/RoutineActions", entities: [Routine, Exercise] } action deleteRoutine { fn: import { deleteRoutine } from "@src/dashboard/routines/RoutineActions", entities: [Routine] } // Routine Route route RoutinesRoute { path: "/routines", to: RoutinesPage } page RoutinesPage { component: import RoutinesPage from "@src/dashboard/routines/RoutinesPage", authRequired: true }

Schema.prisma

model User { id String @id @default(uuid()) routines Routine[] // Relación de uno a muchos con rutinas } model Routine { id Int @id @default(autoincrement()) name String exercises Exercise[] // Relación muchos-a-muchos con ejercicios user User @relation(fields: [userId], references: [id]) userId String } model Exercise { id Int @id @default(autoincrement()) name String instructions String difficulty Difficulty equipmentRequired Boolean equipment String? bodyPart BodyPart @relation(fields: [bodyPartId], references: [id]) bodyPartId Int routines Routine[] } model BodyPart { id Int @id @default(autoincrement()) name String @unique // Nombre de la parte del cuerpo description String? // Añade esta línea exercises Exercise[] // Relación uno-a-muchos con ejercicios }


Where and why do you think this error occurs, how can we solve it? Which code of my project would help you to solve the problem?
Was this page helpful?