Dashboardcraftgetsentry/craft: pnpm overrides don't a…

getsentry/craft: pnpm overrides don't apply to auto-installed peer deps — must add as direct devDep

Category: gotcha
Confidence: 0.90
ID: 019ef40b-f5dc-7b01-a2d4-0d92e67e530b
Project ID: e16af391-c497-4837-b681-c849a5514499
Cross-project: No
Recalled in other projects: 0
Source session: 0BmGcTAoXDxCbYvUm
Created: 2026-06-23 10:34:45
Updated: 2026-06-23 10:34:45

Content

Trap: adding a pnpm.overrides entry for a package (e.g., "vite": "^7.3.5") looks like it should force that version everywhere, including peer dep resolution. Fix: pnpm overrides do NOT apply to automatically-installed peer dependencies. The override appears in the lockfile header but the peer dep still resolves to its own preferred version. Solution: add the package as a direct devDependency (pnpm add -D vite@^7.3.5) — this pins the version in the lockfile and peer dep resolution picks it up. The override entry can be kept for belt-and-suspenders but the direct dep is what actually works.

Move to: