Skip to content

Fix Docker build with pnpm@latest#27

Merged
BlueManCZ merged 2 commits into
mainfrom
fix-pnpm-overrides-location
May 18, 2026
Merged

Fix Docker build with pnpm@latest#27
BlueManCZ merged 2 commits into
mainfrom
fix-pnpm-overrides-location

Conversation

@BlueManCZ
Copy link
Copy Markdown
Owner

Summary

The Docker build (pnpm@latest via corepack) fails with pnpm install --frozen-lockfile because of two breaking changes between pnpm 10 (used by GitHub Actions CI) and pnpm 11 (currently latest):

  1. pnpm.overrides in package.json is no longer read — pnpm 11 ignores the field and the lockfile's overrides: no longer matches the active config, producing ERR_PNPM_LOCKFILE_CONFIG_MISMATCH.
  2. Ignored dependency build scripts are a hard error — pnpm 11 errors with ERR_PNPM_IGNORED_BUILDS for esbuild, where pnpm 10 only printed a warning.

CI never caught either because pnpm/action-setup@v4 pins pnpm to version 10.

Changes

  • Move overrides from frontend/package.json (pnpm.overrides) to a new frontend/pnpm-workspace.yaml — the new home pnpm has moved these settings to.
  • Update frontend/Dockerfile to also COPY pnpm-workspace.yaml so the install can read it.
  • Pass --ignore-scripts to pnpm install in 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-lockfile succeeds locally with pnpm 10
  • pnpm typecheck passes
  • pnpm lint passes
  • docker compose build frontend-build succeeds on a Pi running pnpm 11.1.3 via corepack prepare pnpm@latest --activate (vite build completes, image built)

BlueManCZ added 2 commits May 18, 2026 21:06
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).
@BlueManCZ BlueManCZ merged commit a31f1d5 into main May 18, 2026
3 checks passed
@BlueManCZ BlueManCZ deleted the fix-pnpm-overrides-location branch May 18, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant