fix(docker): copy pnpm-workspace.yaml into the deps stage - #3
Merged
Merged
Conversation
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BaSzXHiVdswD9rKoVh9Ln4
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Fixes a Docker build failure in the deps stage by ensuring pnpm’s workspace-level overrides configuration is available during a frozen install, aligning the Docker install environment with what CI/local builds already have.
Changes:
- Copy
pnpm-workspace.yamlinto the Dockerdepsstage sopnpm install --frozen-lockfiledoesn’t fail with lockfile config mismatch. - Update
next-env.d.tsto reference.next/dev/typesroute typings. - Ignore
.claude/worktrees/scratch checkouts in.gitignore.
Reviewed changes
Copilot reviewed 1 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Dockerfile | Ensures pnpm workspace config is present during the frozen install in the deps stage. |
| next-env.d.ts | Adjusts generated Next.js type import paths to use .next/dev/types. |
| .gitignore | Excludes agent scratch worktrees from git status/noise. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Picks up the Vercel standalone fix (#2) so this branch's preview deploy builds against the corrected config.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Docker build is broken
The deps stage copies only
package.jsonandpnpm-lock.yaml. pnpm 10+ readsoverridesfrompnpm-workspace.yaml(this repo pinspostcss: 8.5.14there), and the lockfile records them — so a frozen install without that file aborts:CI and local builds never hit it because they run against a full checkout where the file is always present. Only the Docker image, which copies a deliberate subset, is affected.
Verification
Docker isn't running here, so rather than claim an untested fix I mirrored the deps stage in a scratch directory using the exact file set it copies, with the same pnpm (11.0.9) and the same
--frozen-lockfileflag:package.json+pnpm-lock.yaml(before)ERR_PNPM_LOCKFILE_CONFIG_MISMATCH+ pnpm-workspace.yaml(after)Done in 2.4s using pnpm v11.0.9This proves the failing step and the fix, not the whole image build — a real
docker buildis still worth running before relying on it.Lint clean, typecheck clean, 37/37 tests,
next buildclean.Also lands local state main didn't have
You asked for everything your working copy had that main didn't. That was two things:
next-env.d.ts→ points at.next/dev/types, whatnext devwrites. Next rewrites this per command (next buildflips it back to.next/types), so it will keep showing as modified whichever variant is committed. CI is unaffected —pnpm typecheckrunsnext typegenfirst. If the churn is annoying, gitignoring the file is the usual escape; say the word..gitignore→ excludes.claude/worktrees/, the scratch checkouts agent worktrees create. That directory was showing as untracked in your working copy. Scoped to the subdirectory so.claude/settings.jsonstays trackable.🤖 Generated with Claude Code
https://claude.ai/code/session_01BaSzXHiVdswD9rKoVh9Ln4