Open mltwist-brice opened 2 years ago
I'm sorry for the late reply. Did you manage to resolve this issue?
If not, does it only happen in the browser or also on the server?
I had this issue today. $on
doesn't exist on clients with extensions.
Might be worth filling an issue with prisma
.
+1
+1
Hi, I'd faced with the same problem
What is the problem?
While using the enhancePrisma Prisma client from Blitz, prisma.$on throws a runtime type error in the browser saying
TypeError: prisma.$on is not a function
. However, Prisma middleware such as prisma.$use(...) appears to work and be recognized by typescript. In VS Code it shows me the intellisense and doesn't highlight it as a type error, but during runtime usingblitz dev
it throws an error in the browser.Paste all your error logs here:
Paste all relevant code snippets here:
What are detailed steps to reproduce this?
enhancePrismaClient.$on("query", (e) => {...})
blitz dev
Run
blitz -v
and paste the output here:Please include below any other applicable logs and screenshots that show your problem: