P
Prisma5mo ago
Ramparts

Cannot find module '@prisma/client/runtime/query_compiler_bg.mysql.wasm on vercel

As above, using the query compiler, now my project cannot find the WASM File. before, it couldnt find the binary. This only happens on vercel, it's fine locally, and it's also fine on an EC2
5 Replies
Prisma AI Help
Prisma AI Help5mo ago
You decided to hold for human wisdom. We'll chime in soon! Meanwhile, #ask-ai is there if you need a quick second opinion.
Ramparts
RampartsOP5mo ago
generator client { provider = "prisma-client" output = "../generated/prisma" previewFeatures = ["queryCompiler", "driverAdapters"] } datasource db { provider = "mysql" url = env("DB_URL") shadowDatabaseUrl = env("SHADOW_DB_URL") } import { PrismaClient, PrismaMariaDb } from "@app/database"; function createPrisma() { const adapter = new PrismaMariaDb({ host: process.env.DB_HOST, port: parseInt(process.env.DB_PORT || "3306", 10), user: process.env.DB_USER, password: process.env.DB_PASSWORD, database: process.env.DB_DATABASE }); return new PrismaClient({ adapter }); } const globalForPrisma = global as unknown as { prisma: ReturnType<typeof createPrisma>; }; export const prisma = globalForPrisma.prisma ?? createPrisma(); if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma; export default prisma; \nInvalid prisma.staff.findMany() invocation:\n\n\nCannot find module '@prisma/client/runtime/query_compiler_bg.mysql.wasm'\nRequire stack:\n- /vercel/path0/packages/database/generated/prisma/internal/class.ts" @app/database:prisma:generate-engine: @app/database:prisma:generate-engine: > @app/database@0.0.0 prisma:generate-engine @app/database:prisma:generate-engine: > prisma generate --no-hints @app/database:prisma:generate-engine: @app/database:prisma:generate-engine: Prisma schema loaded from prisma/schema.prisma @app/database:prisma:generate-engine: @app/database:prisma:generate-engine: ✔ Generated Prisma Client (6.12.0) to ./generated/prisma in 868ms @app/database:prisma:generate-engine: @app/api:build:api: cache miss, executing 24f41a7d503555af
Nurul
Nurul5mo ago
It seems that you are running into this issue: https://github.com/prisma/prisma/issues/27486
GitHub
Error: ENOENT: no such file or directory, open '/var/task/prisma/ge...
Bug description We have been using prisma for some time and are already aware how to get it working in aws lambda with the rust engine. We are now attempting to use prisma within an aws lambda usin...
Ramparts
RampartsOP5mo ago
Yes, i've spoken to vercel support, and they confirmed its a library issue, not their infra Can I ask - there's ALOT of vercel / prisma related issues due to the wasm/binaries being generated on build. Is there an active line of communication between the two companies to resolve these, as they effect a reasonable amount of the userbase On digging deeper, it seems as though the WASM files are being places into the node_modules/@client/runtime folder on build, instead of into the generated/prisma folder - is this correct behavior @Nurul ?
Ramparts
RampartsOP5mo ago
see shots
No description
No description

Did you find this page helpful?