"PrismaClient is unable to be run in the browser" in Next.js API route
Title. I have an API route that returns an ImageResponse, and it's showing this error when I try to open it in the browser, doesn't make sense:
5 Replies
https://github.com/prisma/prisma/issues/6219
not sure if your issue is the same as this
GitHub
PrismaClient is unable to be run in the browser. · Issue #6219 · p...
Bug description I'm getting an Error: PrismaClient is unable to be run in the browser. How to reproduce Create new Node Project with npm init -y install dependencies npm i next react react-dom ...
can you send the api route code?
i did this and it fixed it
🤷
i am not connecting to a DB in my browser at all lol that's why this error is weird
agreed
Your probably importing some server code into your client side code somehow, worth a check so you don't leak anything
^^ I agree