Deploying a Prisma 6/7 app fails at runtime with Cannot find module '@prisma/client/runtime/querycompilerbg.postgresql.wasm' (code MODULENOTFOUND) even though it works locally. Reported on Vercel and in Docker. Two distinct causes surfaced in the thread: the generator's runtime did not match the actual runtime (e.g. runtime = "bun" while building with Node/bun build --compile, which does not bundle .wasm files), and a version mismatch between the prisma CLI and @prisma/client packages.
Cannot find module '@prisma/client/runtime/query_compiler_bg.postgresql.wasm' (MODULE_NOT_FOUND)
First check for a version mismatch: npx prisma --version and make sure prisma and @prisma/client are on the same version; several reporters fixed it by upgrading both packages to the same release (e.g. both to 7.3.0). If versions match, check the generator runtime: if your schema says runtime = "bun" but you build/run with Node (or bun build --compile, which skips bundling .wasm files), switch the generator to runtime = "nodejs" and re-run prisma generate. A maintainer suggested exactly this switch and the reporter confirmed it fixed Docker builds. Also worth trying: delete node_modules plus build caches (.next, .output) and reinstall/re-generate from clean state. Source: https://github.com/prisma/prisma/issues/27754