Dashboardcraftpnpm gotchas: lockfile conflicts, overr…

pnpm gotchas: lockfile conflicts, overrides, workspace cascade

Category: gotcha
Confidence: 1.00
ID: 019fa896-e1de-7551-bdb9-bce5ad328264
Project ID: e16af391-c497-4837-b681-c849a5514499
Cross-project: No
Recalled in other projects: 2
Source session: (none)
Created: 2026-07-28 10:16:22
Updated: 2026-07-28 11:58:08

Cross-Project Recalls

ProjectHitsLast recalled
cli 1 6d ago
Code 1 9d ago

Content

pnpm gotchas: (1) Lock file conflicts: never manually resolve — git checkout --theirs pnpm-lock.yaml then pnpm install to regenerate. git stash pop after merge can re-conflict; drop the stash and re-run instead. (2) Overrides: >= crosses major versions — use ^ to stay in-major. Version-range selectors don't reliably force re-resolution of compatible transitive deps; use blanket overrides when all consumers are on same major. (3) Overrides go stale on tree changes — audit with pnpm why and remove orphans. (4) Root pnpm.overrides does NOT cascade into workspace sub-projects with their own lockfile (e.g. docs/). Concrete case: root postcss: ^8.5.10 resolved to 8.5.15 (vulnerable, <= 8.5.17, GHSA-r28c-9q8g-f849) and left docs/ on 8.5.15 too. Fix required adding postcss: ^8.5.18 to BOTH root and docs/package.json (resolves 8.5.24). When fixing a transitive vuln, check EVERY workspace package.json + lockfile, not just root.

Move to: