Implement official Prisma solution for client generation

Following Prisma's official documentation for deployment caching issues:
https://www.prisma.io/docs/orm/more/help-and-troubleshooting/vercel-caching-issue

Changes:
- Add 'prisma generate' to build script (official Prisma recommendation)
- Add postinstall script for automatic client generation
- Remove custom stub generator workaround
- Keep runtime Prisma client generation in entrypoint.sh for reliability
- Add openssl to runtime container (required for Prisma engines)

This follows Prisma best practices: explicitly run prisma generate during the
build process to ensure Prisma Client is always up-to-date. The entrypoint
script regenerates the client at runtime to guarantee engine availability in
the production environment.
This commit is contained in:
Claude
2025-11-04 20:55:36 +00:00
parent a2ae1f5baa
commit 94edfe08bc
4 changed files with 19 additions and 149 deletions

View File

@@ -5,11 +5,11 @@
"private": true,
"scripts": {
"dev": "next dev",
"build": "node scripts/generate-prisma-stub.js && next build",
"build": "prisma generate && next build",
"start": "next start",
"lint": "next lint",
"typecheck": "tsc --noEmit",
"postinstall": "node scripts/generate-prisma-stub.js || prisma generate || echo 'Prisma generate failed, using stub'"
"postinstall": "prisma generate || echo 'Prisma generate skipped'"
},
"dependencies": {
"@emotion/react": "^11.14.0",