PrismaP
Prisma6mo ago
7 replies
thejacer87

pnpm workspace/monorepo using nuxt: ✘ [ERROR] Could not resolve ".prisma/client/index-browser"

I think this is related (maybe) to this known issue: https://www.prisma.io/docs/orm/more/help-and-troubleshooting/prisma-nuxt-module#resolving-typeerror-failed-to-resolve-module-specifier-prismaclientindex-browser

here's my error:

✘ [ERROR] Could not resolve ".prisma/client/index-browser"

    ../../node_modules/.pnpm/@prisma+client@6.14.0_typescript@5.9.2/node_modules/@prisma/client/index-browser.js:1:23:
      1 │ const prisma = require('.prisma/client/index-browser')
        ╵                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  You can mark the path ".prisma/client/index-browser" as external to exclude it from the bundle,
  which will remove this error and leave the unresolved path in the bundle. You can also surround
  this "require" call with a try/catch block to handle this failure at run-time instead of
  bundle-time.


but when i add the fix, i still get the same error

i am using the nuxt module, and the prisma stuff is in a separate nuxt layer.

so i assume there are quite a few points of failure, but maybe somebody has experienced this already?

perhaps i just need to put a different path in the vite alias cuz of the pnpm workspace does funky things, or hoisting something specific (i don't understand hoisting tbh)
Learn how to easily add Prisma ORM to your Nuxt apps, use its features, and understand its limitations.
Add Prisma ORM Easily to Your Nuxt Apps | Prisma Documentation
Was this page helpful?