Getting "PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in 'node')" after Upgrading prisma
fddayan opened this issue · comments
After upgrading prisma
and prisma-client
to 5.10.2
and upgrade jest-prisma
to 1.8.0
I have been getting
PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in "node"). If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report
Full error:
● Test suite failed to run
PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `node`).
If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report
at Object.get (../../../node_modules/.prisma/client/index-browser.js:505:15)
at PrismaEnvironmentDelegate.teardown (../../../node_modules/@quramy/jest-prisma-core/lib/delegate.js:69:29)
at PrismaEnvironment.teardown (../../../node_modules/@quramy/jest-prisma/lib/environment.js:22:60)
I think is related to this line:
https://github.com/Quramy/jest-prisma/blob/main/packages/jest-prisma/src/environment.ts#L4
It’s related to #133
Use jest-prism-node, https://github.com/Quramy/jest-prisma/tree/main/packages/jest-prisma-node