fix(ci): fix convex missing from prune output and npm version mismatch
Some checks failed
CI / Lint, Typecheck & Test (push) Successful in 2m5s
Deploy — Staging / Lint, Typecheck & Test (push) Successful in 2m5s
Deploy — Staging / Build & push — admin (push) Failing after 3m11s
Deploy — Staging / Build & push — storefront (push) Failing after 2m23s
Deploy — Staging / Deploy to staging VPS (push) Has been skipped
Some checks failed
CI / Lint, Typecheck & Test (push) Successful in 2m5s
Deploy — Staging / Lint, Typecheck & Test (push) Successful in 2m5s
Deploy — Staging / Build & push — admin (push) Failing after 3m11s
Deploy — Staging / Build & push — storefront (push) Failing after 2m23s
Deploy — Staging / Deploy to staging VPS (push) Has been skipped
Two root causes for the Docker build failures: 1. convex/_generated/api not found (both apps) turbo prune only traces npm workspace packages; the root convex/ directory is not a workspace package so it is excluded from out/full/. Copy it manually into the prune output after turbo prune runs. 2. @heroui/react not found (storefront) package-lock.json was generated with npm@11 but node:20-alpine ships npm@10. turbo warns it cannot parse the npm 11 lockfile and generates an incomplete out/package-lock.json, causing npm ci inside Docker to miss packages. Upgrade npm to 11 in the deps stage of both Dockerfiles. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -77,7 +77,13 @@ jobs:
|
||||
run: npm ci
|
||||
|
||||
- name: Prune workspace for ${{ matrix.app }}
|
||||
run: npx turbo prune ${{ matrix.app }} --docker
|
||||
run: |
|
||||
npx turbo prune ${{ matrix.app }} --docker
|
||||
# turbo prune only traces npm workspace packages. The root convex/ directory
|
||||
# is not a workspace package, so it is excluded from out/full/ — causing
|
||||
# "Module not found: convex/_generated/api" at build time.
|
||||
# Copy it manually so the Dockerfile has the generated types it needs.
|
||||
cp -r convex out/full/convex
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
@@ -9,6 +9,12 @@ FROM node:20-alpine AS deps
|
||||
RUN apk add --no-cache libc6-compat
|
||||
WORKDIR /app
|
||||
|
||||
# Upgrade npm to match the project's packageManager (npm@11). The package-lock.json
|
||||
# was generated with npm 11 — npm 10 (bundled with node:20) can't fully parse it,
|
||||
# causing turbo prune to generate an incomplete pruned lockfile and npm ci to miss
|
||||
# packages.
|
||||
RUN npm install -g npm@11 --quiet
|
||||
|
||||
COPY json/ .
|
||||
COPY package-lock.json .
|
||||
RUN npm ci
|
||||
|
||||
@@ -12,6 +12,12 @@ FROM node:20-alpine AS deps
|
||||
RUN apk add --no-cache libc6-compat
|
||||
WORKDIR /app
|
||||
|
||||
# Upgrade npm to match the project's packageManager (npm@11). The package-lock.json
|
||||
# was generated with npm 11 — npm 10 (bundled with node:20) can't fully parse it,
|
||||
# causing turbo prune to generate an incomplete pruned lockfile and npm ci to miss
|
||||
# packages like @heroui/react.
|
||||
RUN npm install -g npm@11 --quiet
|
||||
|
||||
COPY json/ .
|
||||
COPY package-lock.json .
|
||||
RUN npm ci
|
||||
|
||||
Reference in New Issue
Block a user