studio
studio copied to clipboard
Error: Invalid `prisma.pricings.findMany()` invocation: Value not found in enum
trafficstars
-
Prisma version (
prisma -vornpx prisma -v): 5.11.0 -
Logs from Developer Tools Console or Command line, if any:
PrismaClientUnknownRequestError:
Invalid `prisma.pricings.findMany()` invocation:
Value 'EVERYWHERE' not found in enum 'PricingsCurrency'
at In.handleRequestError (/Users/6ones/Projects/fela/fela.ai/node_modules/@prisma/client/runtime/library.js:122:7044)
at In.handleAndLogRequestError (/Users/6ones/Projects/fela/fela.ai/node_modules/@prisma/client/runtime/library.js:122:6188)
at In.request (/Users/6ones/Projects/fela/fela.ai/node_modules/@prisma/client/runtime/library.js:122:5896)
at async l (/Users/6ones/Projects/fela/fela.ai/node_modules/@prisma/client/runtime/library.js:127:10871)
....{
clientVersion: '5.11.0'
}
- Does the issue persist even after updating to the latest
prismaCLI dev version? (npm i -D prisma@dev) Yes - Prisma schema (if relevant):
enum PricingsType {
TRIAL
DAILY
WEEKLY
}
enum PricingsCurrency {
NGN
KSH
EVERYWHERE
}
model Billings {
id Int @id @default(autoincrement())
userId String // Supabase Auth User ID
pricing Pricings @relation(fields: [pricingId], references: [id])
pricingId Int
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Pricings {
id Int @id @default(autoincrement())
type PricingsType
amount Float
currency PricingsCurrency
numberOfDays Int
isActive Boolean @default(true)
billings Billings[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
I noticed this error happens when I include a new value to the Enum and add that to the database, and try to read from the database.
Did you restart Prisma Studio after doing so? It seems to still be using the old enum definition, and then getting data it does not know what to do about.