Fix Docker build with pnpm@latest#27
Merged
Merged
Conversation
The 'pnpm' field in package.json is no longer read by recent pnpm versions (used by the Dockerfile via 'pnpm@latest'), causing ERR_PNPM_LOCKFILE_CONFIG_MISMATCH on 'pnpm install --frozen-lockfile'. Move the overrides to pnpm-workspace.yaml, the new home for these settings, and update the Dockerfile to copy it.
pnpm 11 (used by 'pnpm@latest' in the Dockerfile) treats ignored build scripts as a hard error rather than the warning pnpm 10 produced, blocking the Docker build on esbuild's postinstall. Pass --ignore-scripts to explicitly skip dependency lifecycle scripts (esbuild's per-platform binaries are already provided by its @esbuild/* sub-packages, so its postinstall is not required).
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.
Summary
The Docker build (
pnpm@latestvia corepack) fails withpnpm install --frozen-lockfilebecause of two breaking changes between pnpm 10 (used by GitHub Actions CI) and pnpm 11 (currentlylatest):pnpm.overridesinpackage.jsonis no longer read — pnpm 11 ignores the field and the lockfile'soverrides:no longer matches the active config, producingERR_PNPM_LOCKFILE_CONFIG_MISMATCH.ERR_PNPM_IGNORED_BUILDSforesbuild, where pnpm 10 only printed a warning.CI never caught either because
pnpm/action-setup@v4pins pnpm to version 10.Changes
frontend/package.json(pnpm.overrides) to a newfrontend/pnpm-workspace.yaml— the new home pnpm has moved these settings to.frontend/Dockerfileto alsoCOPY pnpm-workspace.yamlso the install can read it.--ignore-scriptstopnpm installin the Dockerfile to explicitly skip dependency lifecycle scripts (esbuild's per-platform binaries are already provided by its@esbuild/*sub-packages, so its postinstall is not required — pnpm 10 was already skipping it with a warning, this just makes it explicit).Test plan
pnpm install --frozen-lockfilesucceeds locally with pnpm 10pnpm typecheckpassespnpm lintpassesdocker compose build frontend-buildsucceeds on a Pi running pnpm 11.1.3 viacorepack prepare pnpm@latest --activate(vite build completes, image built)