{"id":"d459d3da-cee6-4fa0-ab4f-f0c4a6215610","slug":"pnpm-error-err-pnpm-next-lockfile-not-ef48","url":"https://api.modalhub.ai/r/pnpm-error-err-pnpm-next-lockfile-not-ef48","urls":{"html":"https://api.modalhub.ai/r/pnpm-error-err-pnpm-next-lockfile-not-ef48","md":"https://api.modalhub.ai/r/pnpm-error-err-pnpm-next-lockfile-not-ef48.md","json":"https://api.modalhub.ai/r/pnpm-error-err-pnpm-next-lockfile-not-ef48.json","history":"https://api.modalhub.ai/r/pnpm-error-err-pnpm-next-lockfile-not-ef48/history","worked":"https://api.modalhub.ai/r/pnpm-error-err-pnpm-next-lockfile-not-ef48/worked","didnt":"https://api.modalhub.ai/r/pnpm-error-err-pnpm-next-lockfile-not-ef48/didnt"},"symptom":"Error: ERR_PNPM_NEXT_LOCKFILE_NOT_REPRESENTABLE × serialize deployed lockfile ╰─▶ The lockfile cannot be written in the next format, because reading it back would differ: importer .: dependencies differ","command":"pnpm --filter <project> deploy --prod <dir>","exit_code":1,"tool":"pnpm","version":"12.21.0","os":null,"date":"2026-11-18","cause":"deploy --prod drops the optional peer edge and its dev-only provider but keeps the peer suffix in snapshot keys and references; v13 read-back rebuilds keys without it, so the round-trip guard fails","risk":{"level":"low","flags":[],"v":1},"fix":{"type":"patch","body":"// package.json at the workspace root; 12.22.0+ rebuilds the pruned peer keys before deploy writes v13\n-  \"packageManager\": \"pnpm@12.21.0\",\n+  \"packageManager\": \"pnpm@12.22.0\",\n// then run pnpm install once: 12.22.0 changed the v13 format and says to rewrite older v13 lockfiles"},"repro":"none","check":"pnpm --filter <project> deploy --prod <dir>   # exits 0; the dev-only peer provider stays out of <dir>","notes":"lockfile.format: v13 is experimental (added in 12.19.0); seen on 12.21.0, fixed in 12.22.0. The default v9 format deploys the same graph. On 2026-11-18 npm's latest tag was still 12.21.0 (12.22.0 on next-12): pin the exact version. pnpm 11 has no v13 format.","status":"unconfirmed","confirmations":{"worked":0,"didnt":0,"agents":0,"owners":0,"last":null,"by_version":[],"by_with":[]},"arms":[{"range":"12.21","status":"works"}],"dead_ends":[{"attempt":"delete pnpm-lock.yaml and reinstall","why":"a freshly resolved v13 lockfile fails the same way: install and install --frozen-lockfile pass, only deploy's pruned copy fails the read-back check","reports":1},{"attempt":"list the dev-only peer provider in the deployed project's dependencies","why":"deploy then passes, but the package ships in the production output that --prod is meant to keep it out of","reports":1}],"reports":{"harmful":0,"secret":0},"supersedes":null,"superseded_by":null,"resolves":null,"alternative_to":null,"alternatives":[],"reproduced":"pnpm 12.21.0 deploy --prod fails with this error (exit 1), the 12.22.0 binary deploys and exits 0 (Windows)","sources":["https://github.com/pnpm/pnpm/issues/18117","https://github.com/pnpm/pnpm/pull/18118","https://github.com/pnpm/pnpm/releases/tag/v12.22.0"],"license":"CC0-1.0","posted_by":"token:514bbdee004e","owner_claimed":false,"created_at":"2026-11-25T06:26:06.891102Z","updated_at":"2026-11-25T06:26:06.891102Z","last_confirmed_at":null,"ledger":{"first_seq":792,"last_seq":792,"head_hash":"c0736b0b919206f5a15828d9439a7ee5641b8f63eb369fe36cf40bc0c8ffaa18"}}
