Re-run prisma generate against the deploy tree
CI / test (push) Successful in 23s
CI / lint (push) Successful in 26s
CI / secrets-scan (push) Successful in 5s
CI / vuln-scan (push) Successful in 13s
CI / sast (push) Successful in 10s
CI / build-images (push) Successful in 1m51s
CI / image-scan (push) Successful in 43s
CI / push (push) Successful in 33s
CI / test (push) Successful in 23s
CI / lint (push) Successful in 26s
CI / secrets-scan (push) Successful in 5s
CI / vuln-scan (push) Successful in 13s
CI / sast (push) Successful in 10s
CI / build-images (push) Successful in 1m51s
CI / image-scan (push) Successful in 43s
CI / push (push) Successful in 33s
The deployed backend was crashing with `Cannot read properties of undefined (reading 'CREDIT')` on `client_1.AccountType.CREDIT`. The .prisma/client/index.js inside the image was the unpopulated stub that ships with @prisma/client; the schema-specific client (enums, models, etc.) wasn't there. Cause: pnpm deploy --prod pulls a fresh @prisma/client from the pnpm store rather than copying the live, post-generate state of /repo/node_modules/@prisma/client. The store copy ships with the stub. Our previous `cp -r /repo/node_modules/.prisma` overlay attempted to fix it but didn't land where node's resolver looks from /deploy. Fix: re-run prisma generate against /deploy after pnpm deploy, invoking the CLI from /repo (devDeps still present there) but with cwd=/deploy so the generator writes into the deployed @prisma/client. This produces a runnable image with the right enums/models in place. Bump backend and frontend to 0.1.5 (frontend forced by per-service push gate; no functional change). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -27,10 +27,14 @@ RUN pnpm --filter tehriehlbudget-backend run build
|
||||
# were leaking into the runtime via the workspace's hoisted node_modules.
|
||||
RUN pnpm --filter tehriehlbudget-backend --prod deploy /deploy
|
||||
|
||||
# Overlay the generated Prisma client. pnpm deploy copies the @prisma/client
|
||||
# package as-is, but the co-located .prisma/client/ output directory isn't
|
||||
# a package so it isn't always carried along. Copy it explicitly to be safe.
|
||||
RUN cp -r /repo/node_modules/.prisma /deploy/node_modules/.prisma
|
||||
# pnpm deploy pulls a fresh @prisma/client from the pnpm store, which ships
|
||||
# with an unpopulated `.prisma/client/index.js` stub (it throws "did not
|
||||
# initialize yet" if loaded). Re-run `prisma generate` against the deploy
|
||||
# tree so the schema-specific client (enums, models, etc.) lands in
|
||||
# /deploy/node_modules/.prisma/client. The CLI is a devDep so it's not in
|
||||
# /deploy — invoke it from /repo where the full install still has it.
|
||||
RUN cd /deploy && /repo/node_modules/.bin/prisma generate \
|
||||
--schema=./prisma/schema.prisma
|
||||
|
||||
FROM node:${NODE_VERSION}-alpine AS runtime
|
||||
RUN apk add --no-cache libc6-compat openssl tini \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "tehriehlbudget-backend",
|
||||
"version": "0.1.4",
|
||||
"version": "0.1.5",
|
||||
"description": "",
|
||||
"author": "",
|
||||
"private": true,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "tehriehlbudget-frontend",
|
||||
"private": true,
|
||||
"version": "0.1.4",
|
||||
"version": "0.1.5",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
Reference in New Issue
Block a user