Prisma error when generating in turborepo #7937
-
SummaryBug descriptionWhen I try to compile my nextjs project in my turborepo with after my prisma codegen I get the error. It is worth to note that my prisma is located inside the nextjs project not in a database package as both my apps need a database as the turborepo example outlines a scenario where the entire turborepo shares a database and schema. 29.01 qrtag:build: ./prisma/client/runtime/edge-esm.js:1:1
29.01 qrtag:build: Type error: Declaration emit for this file requires using private name 'i'. An explicit type annotation may unblock declaration emit. The project is running inside a turborepo and i'm trying to create a docker image using the following dockerfile.
How to reproduceNo idea Expected behaviorExpected behavior is that the compilation works and the NextJS compiles without type errors. Prisma informationgenerator client {
provider = "prisma-client-js"
output = "../prisma/client"
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
model EventTag {
id Int @id @default(autoincrement()) @db.UnsignedInt
userId Int @db.UnsignedInt
eventId Int @db.UnsignedInt
targetId Int @db.UnsignedInt
timestamp DateTime @default(now()) @db.DateTime(0)
target User @relation("event_tags_target_idTousers", fields: [targetId], references: [id], onUpdate: Restrict, map: "event_tags_target_id_foreign")
eventUser EventUser @relation(fields: [userId, eventId], references: [userId, eventId])
user User @relation(fields: [userId], references: [id])
event Event @relation(fields: [eventId], references: [id])
@@index([targetId], map: "event_tags_target_id_foreign")
}
model EventUser {
id Int @id @default(autoincrement()) @db.UnsignedInt
userId Int @db.UnsignedInt
eventId Int @db.UnsignedInt
isAlive Boolean @default(true)
secret String @db.VarChar(255)
targetId Int? @db.UnsignedInt
event Event @relation(fields: [eventId], references: [id], onUpdate: Restrict, map: "event_users_event_id_foreign")
target User? @relation("event_users_target_idTousers", fields: [targetId], references: [id], onUpdate: Restrict, map: "event_users_target_id_foreign")
user User @relation("event_users_user_idTousers", fields: [userId], references: [id], onUpdate: Restrict, map: "event_users_user_id_foreign")
tags EventTag[]
@@unique([userId, eventId])
@@index([eventId], map: "event_users_event_id_foreign")
@@index([targetId], map: "event_users_target_id_foreign")
@@index([userId], map: "event_users_user_id_foreign")
}
model Event {
id Int @id @default(autoincrement()) @db.UnsignedInt
name String @db.VarChar(255)
startDate DateTime @db.DateTime(0)
endDate DateTime @db.DateTime(0)
targetsAssigned Boolean @default(false)
winnerId Int? @db.UnsignedInt
winner User? @relation(fields: [winnerId], references: [id])
EventUser EventUser[]
EventTag EventTag[]
}
model User {
id Int @id @default(autoincrement()) @db.UnsignedInt
username String @unique @db.VarChar(255)
displayName String @db.VarChar(255)
class String @db.VarChar(6)
createdAt DateTime @default(now()) @db.DateTime(0)
updatedAt DateTime @default(now()) @db.DateTime(0)
eventTargetTags EventTag[] @relation("event_tags_target_idTousers")
eventTargets EventUser[] @relation("event_users_target_idTousers")
eventUsers EventUser[] @relation("event_users_user_idTousers")
userAdmin UserAdmin?
Event Event[]
EventTag EventTag[]
}
model UserAdmin {
id Int @id @default(autoincrement()) @db.UnsignedInt
userId Int @unique @db.UnsignedInt
user User @relation(fields: [userId], references: [id])
createdAt DateTime @default(now()) @db.DateTime(0)
updatedAt DateTime @default(now()) @db.DateTime(0)
} Environment & setup
Prisma Versionprisma : 5.11.0 Additional informationNo response ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You may have better luck reporting an Issue on the Prisma repository. |
Beta Was this translation helpful? Give feedback.
-
Hey @dinkelspiel. I have encountered the same issue and this sequence of steps allowed a successful NextJS build without type errors 🥳. Below is my example, the docker file is taken from the handbook:
NOTE:
My
Root
|
Beta Was this translation helpful? Give feedback.
You may have better luck reporting an Issue on the Prisma repository.