Bug or what?
Answered
Silver posted this in #help-forum
SilverOP
Hello! I'm trying to create an API. I'm using NextAuth and Prisma. But when i get an error 500 instead of giving me the error, it shows me the entire js comprossed like the screenshot. What can be? Using last version of everything. Next, NextAuth and prisma.
Answered by Saltwater Crocodile
In aggreate(), you can't use select inside _sum. You need to list the numeric fields directly under _sum.
I hit the same thing before, once you remove select and make sure the field exists and is numeric in schema.prisma, it works fine.
let me know if totoalPrice is in your schema or if it's computed somewhere.
I hit the same thing before, once you remove select and make sure the field exists and is numeric in schema.prisma, it works fine.
let me know if totoalPrice is in your schema or if it's computed somewhere.
7 Replies
SilverOP
PS: Working on Windows.
Update: i can see that is Prisma error probably, i got an error that showed me "less" javascript so i could see that was prisma causing this, (just see the scroll bar how small it is for the quantity of output it gives) but never see something like that anyway.
@Silver Update: i can see that is Prisma error probably, i got an error that showed me "less" javascript so i could see that was prisma causing this, (just see the scroll bar how small it is for the quantity of output it gives) but never see something like that anyway.
Saltwater Crocodile
I figured it out, i think this was a Prisma schema issue, not Windows or Docker related.
Saltwater Crocodile
In aggreate(), you can't use select inside _sum. You need to list the numeric fields directly under _sum.
I hit the same thing before, once you remove select and make sure the field exists and is numeric in schema.prisma, it works fine.
let me know if totoalPrice is in your schema or if it's computed somewhere.
I hit the same thing before, once you remove select and make sure the field exists and is numeric in schema.prisma, it works fine.
let me know if totoalPrice is in your schema or if it's computed somewhere.
Answer
SilverOP
Probably you're right! I am checking everywhere if i get more errors but seems it disappeared.
You're the man.
SilverOP
Confirmed, it was that @Saltwater Crocodile ! Thanks!