From 4e727e2562a0b4a54bbf702303685a79d148f612 Mon Sep 17 00:00:00 2001 From: ohm Date: Wed, 5 Aug 2026 11:39:13 +0700 Subject: [PATCH] fix(docker): copy pnpm-workspace.yaml into the deps stage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The deps stage copied only package.json and pnpm-lock.yaml. pnpm 10+ reads `overrides` from pnpm-workspace.yaml, and the lockfile records them, so a frozen install without that file aborts: ERR_PNPM_LOCKFILE_CONFIG_MISMATCH Cannot proceed with the frozen installation. The current "overrides" configuration doesn't match the value found in the lockfile Reproduced by mirroring the deps stage in a scratch directory with the exact file set it copies: it fails as above with two files and completes with pnpm-workspace.yaml added. Not caught earlier because CI and local builds run against a full checkout, where the file is always present. Also lands two pieces of local state main did not have: - next-env.d.ts points at .next/dev/types, which is what `next dev` writes. Next rewrites this file per command — `next build` flips it back to .next/types — so it will keep showing as modified. CI is unaffected because `pnpm typecheck` runs `next typegen` first. - .gitignore now excludes .claude/worktrees/, the scratch checkouts agent worktrees create. Scoped to that subdirectory so .claude/settings.json stays trackable. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01BaSzXHiVdswD9rKoVh9Ln4 --- .gitignore | 3 +++ Dockerfile | 5 ++++- next-env.d.ts | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 5b95214..578e0fc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ # dependencies node_modules/ +# agent worktrees (scratch checkouts, never part of a commit) +.claude/worktrees/ + # Next.js build output .next/ out/ diff --git a/Dockerfile b/Dockerfile index e69e3fa..456dab0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,10 @@ RUN corepack enable && corepack prepare pnpm@11.0.9 --activate FROM base AS deps RUN apk add --no-cache libc6-compat -COPY package.json pnpm-lock.yaml ./ +# pnpm-workspace.yaml is required here, not optional: pnpm 10+ reads +# `overrides` from it, the lockfile records those overrides, and a frozen +# install aborts with ERR_PNPM_LOCKFILE_CONFIG_MISMATCH when it is absent. +COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./ RUN pnpm install --frozen-lockfile FROM base AS builder diff --git a/next-env.d.ts b/next-env.d.ts index ce4e94a..a419cbe 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -1,7 +1,7 @@ /// /// -import "./.next/types/routes.d.ts"; -import "./.next/types/root-params.d.ts"; +import "./.next/dev/types/routes.d.ts"; +import "./.next/dev/types/root-params.d.ts"; // NOTE: This file should not be edited // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.