PKG0007Forward the peers of workspace dependencies
Why it happens
A peer is resolved from the packages above the one that declares it. When package A depends on workspace package B and B requires peer P, an app that installs only A never declares P: a strict install has no P and B fails to load, and an auto-installed P is a copy the app does not share. A development dependency on P covers only A's own tests. Yarn reports the same gap as a missing peer of A.
Fix
Declare the peer in the dependent package's peerDependencies with the same specifier the workspace dependency uses, and keep a devDependency for its own tests. If the dependent never loads the code that needs the peer, declare it as an optional peer instead.
Example
Forward Auth's drizzle-orm peer from Realtime
Before
{ "name": "@acme/realtime", "dependencies": { "@acme/auth": "workspace:*" } }
// @acme/auth: { "peerDependencies": { "drizzle-orm": "^1.0.0" } }
After
{ "name": "@acme/realtime", "dependencies": { "@acme/auth": "workspace:*" }, "peerDependencies": { "drizzle-orm": "^1.0.0" } }
Verify the fix
Run only this rule after editing so the report stays focused on the diagnostic you are closing:
pnpm vite-doctor . --extends package/recommended --rules package/no-unforwarded-peer