Quramy / jest-prisma

Jest environment for integrated testing with Prisma client
MIT License
264 stars 15 forks source link

Getting "PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in 'node')" after Upgrading prisma #137

Open fddayan opened 5 months ago

fddayan commented 5 months ago

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

Quramy commented 5 months ago

It’s related to https://github.com/Quramy/jest-prisma/issues/133

Use jest-prism-node, https://github.com/Quramy/jest-prisma/tree/main/packages/jest-prisma-node