W
Wasp-lang8mo ago
wael

Can anybody help with this problem

[Server!] 19 | following User[] @relation("UserFollows", fields: [followingId], references: [id]) [Server!] 20 | followers User[] @relation("UserFollowed", fields: [followerId], references: [id]) [Server!] 21 | followingId Int [Server!] | [Server!] [Server!] Validation Error Count: 2 [Server!] [Context: getDmmf] [Server!] [Server!] Prisma CLI Version : 4.16.2 [Client] Environment variables loaded from .env [Client] Prisma schema loaded from ../db/schema.prisma [Client!] Error: Prisma schema validation - (get-dmmf wasm) [Client!] Error code: P1012 [Client!] error: Error validating field following in model User: The relation field following on model User is missing an opposite relation field on the model User. Either run prisma format or add it manually. [Client!] --> schema.prisma:19 [Client!] | [Client!] 18 | posts Post[] [Client!] 19 | following User[] @relation("UserFollows", fields: [followingId], references: [id]) [Client!] 20 | followers User[] @relation("UserFollowed", fields: [followerId], references: [id]) [Client!] | [Client!] error: Error validating field followers in model User: The relation field followers on model User is missing an opposite relation field on the model User. Either run prisma format or add it manually. [Client!] --> schema.prisma:20 [Client!] | [Client!] 19 | following User[] @relation("UserFollows", fields: [followingId], references: [id]) [Client!] 20 | followers User[] @relation("UserFollowed", fields: [followerId], references: [id]) [Client!] 21 | followingId Int [Client!] | [Client!] [Client!] Validation Error Count: 2 [Client!] [Context: getDmmf] [Client!] [Client!] Prisma CLI Version : 4.16.2 ❌ --- [Error] Your wasp project failed to compile: ------------------------------- - Prisma client generation failed with exit code: 1 ❌ --- [Error] Compilation of wasp project failed: -------------------------------- 1 errors found
1 Reply
matijash
matijash8mo ago
hmm seems like the schema is missing the other side of the relation definition in Prisma. Can you share your code (main.wasp), or MAGE generation url if that is what you used?