unable to run in browser environemnt #22998
Replies: 3 comments
-
Facing similar issue. |
Beta Was this translation helpful? Give feedback.
-
Hi @techy-ashir 👋 The error message "PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in unknown)" typically occurs when you're trying to run Prisma Client in a browser environment. Prisma Client is designed to run in a server-side environment and does not work in the browser. If you're using Next.js, there are specific ways to ensure Prisma runs on the server-side:
This is because Prisma does not work on the client side as the browser does not execute SQL queries. Prisma has to be added with your Node.js app or inside the backend functions of Next.js. If this answers your question, it would be great if you could mark this Discussion as answered to indicate that it has been resolved. Otherwise please let us know how else we can help you further or close the Discussion if it was resolved in some other way 🙏 |
Beta Was this translation helpful? Give feedback.
-
I got this issue since 5.11.0. I am using vite to build a node js application. Since 5.11.0 it doesnt seem to work anymore. |
Beta Was this translation helpful? Give feedback.
-
Bug description
Error submitting form: Error: PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in
unknown
).How to reproduce
Expected behavior
No response
Prisma information
// Add your schema.prisma
// Add your code using Prisma Client
Environment & setup
Prisma Version
Beta Was this translation helpful? Give feedback.
All reactions