From b5fa7748490756cc7caf9ca0d2d43990aed75473 Mon Sep 17 00:00:00 2001 From: SennayT Date: Thu, 14 May 2026 15:01:36 +0300 Subject: [PATCH] fix build errors on passenger api --- Dockerfile | 9 +++++---- apps/edr-passenger-api/nest-cli.json | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 086b5d751..420fe619e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,10 +30,8 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store\ pnpm install --frozen-lockfile FROM deps AS build COPY . . -# ENV CI=true RUN pnpm run build -RUN find . -name "main.js" FROM base AS freight-api # RUN corepack enable && corepack prepare pnpm@9.12.0 --activate @@ -55,8 +53,11 @@ FROM base AS passenger-api WORKDIR /app/apps/edr-passenger-api ENV NODE_ENV=production -COPY --from=deps /app/node_modules ./../../node_modules -COPY --from=deps /app/apps/edr-passenger-api/node_modules ./node_modules +# Use build-stage node_modules (not deps): `pnpm run build` runs `prisma generate`, which +# writes the real @prisma/client (enums, types). deps never runs generate, so @IsEnum(ServiceClass) +# and similar would see undefined at runtime if we copied deps only. +COPY --from=build /app/node_modules ./../../node_modules +COPY --from=build /app/apps/edr-passenger-api/node_modules ./node_modules COPY --from=build /app/apps/edr-passenger-api/dist ./dist COPY --from=build /app/apps/edr-passenger-api/package.json ./package.json COPY --from=build /app/packages ./../../packages diff --git a/apps/edr-passenger-api/nest-cli.json b/apps/edr-passenger-api/nest-cli.json index 6e3db4584..a7fb60dd2 100644 --- a/apps/edr-passenger-api/nest-cli.json +++ b/apps/edr-passenger-api/nest-cli.json @@ -1,7 +1,9 @@ { + "$schema": "https://json.schemastore.org/nest-cli", "collection": "@nestjs/schematics", "sourceRoot": "src", "compilerOptions": { + "deleteOutDir": true, "plugins": ["@nestjs/swagger"], "tsConfigPath": "tsconfig.build.json", "watchAssets": true