Next.js Discord

Discord Forum

PrismaClient is unable to be run in the browser

Answered
Chub mackerel posted this in #help-forum
Open in Discord
Chub mackerelOP
This has been asked a lot in these forums but haven't seen an answer.

I'm getting the "PrismaClient is unable to be run in the browser" error when deploying to Vercel. Works fine when running locally.

I don't know where the error is coming from. I'm not using edge functions atm. It could be happening because I'm using server actions and Prisma being imported into the client even though it shouldn't. Anyone have ideas? Going to keep experimenting for a solution.
Answered by Chub mackerel
Well I managed to solve it in my case. I had the same error locally. Happened after a refactor. I was no longer importing a server action from a 'use server' file.
View full answer

1 Reply

Chub mackerelOP
Well I managed to solve it in my case. I had the same error locally. Happened after a refactor. I was no longer importing a server action from a 'use server' file.
Answer