What happened
A Vercel production deploy returned 500 on every page. Logs showed Prisma's client init failing because a WASM file was missing.
Cause
Prisma 7 is now Rust-free and ships its query engine as WebAssembly. With the legacy 'prisma-client-js' generator emitting into 'node_modules/.prisma/client', Next.js 16's output file tracing can't statically follow a dynamic import like 'import(./query_compiler_fast_bg.wasm)', so the WASM never makes it into the Lambda bundle.
Fix
- Switch to the 'prisma-client' generator
- Output into the source tree ('src/generated/prisma')
- Update import paths to '@/generated/prisma/client'
- Remove the 'serverExternalPackages' / 'outputFileTracingIncludes' workarounds in 'next.config.ts'
Following the official docs turned out to be the fastest path.
Lessons
- For new majors, just trust the official template
- Hand-curating trace inputs only buys time, not a real fix
- Dynamic imports of WASM expose the limits of static analysis