PrismaP
Prisma2mo ago
9 replies
arsh

Not possible to deploy prisma with Nuxt3

I am trying to deploy my nuxt 3 application with Prisma postgres been 6 hours, without a luck.


I get this error with Prisma 7 +
prisma-client
even the development server is not working

[uncaughtException] WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 63 6f 6e 73 @+0


- nitro.experimental.wasm = true didn't worked
- moduleFormat = "esm" didnt work neither.
- targetting 'edge' didn't work

If i downgrade to prisma 5 and use prisma-client-js dev server and build works, but as soon as i hit api endpoint:
ReferenceError: __dirname is not defined in ES module scope
    at file:///var/task/chunks/nitro/nitro.mjs:7267:16
    at ModuleJob.run (node:internal/modules/esm/module_job:345:25)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:665:26)
    at async d (/opt/rust/nodejs.js:16:22205)
Node.js process exited with exit status: 1. The logs above can help with debugging the issue.



I have issue open:
https://github.com/prisma/prisma/issues/28804

Related issues:
https://github.com/prisma/prisma/issues/28105
https://github.com/prisma/docs/issues/7318

I also tried prisma accelerate with --no-engine which supposed not include wasm, didn't worked neither.

Since I know Prisma, i was only able to get it into working for once and i don't remember how.
Even i follow exact steps from Docs (and the other one for Nuxt) i get WASM error at the end.
I am sure too many developers just gave up and switched to another ORM. Since every "stable" prisma version is actually broken, nothing is stable about prisma. Every time it breaks randomly. The nuxt module itself is not maintained, docs are out-of-date.
GitHub
Bug description I am getting this error in Nuxt 3.21.1, when i rna bun run build: /prisma/schema.prisma: datasource db { provider = "postgresql" } generator client { provider = "pris...
[unwasm] Failed to parse WASM module · Issue #28804 · prisma/prisma
GitHub
Bug description Opening new issue as requested: #28074 (comment) Using Prisma with engineType:client and runtime:cloudflare does not like await import("./query_compiler_bg.wasm?module") i...
Possible WASM loading incompatibility with Vite · Issue #28105 · ...
GitHub
Bug description There is something fundamentally wrong with the run and build of Prisma in Nuxt -- following the exact three steps of the documentation (https://www.prisma.io/docs/orm/more/help-and...
The basic installation from the documentation (for Nuxt) does not r...
Was this page helpful?