-
Notifications
You must be signed in to change notification settings - Fork 195
Description
Describe the bug
When installing @redocly/cli in strict peer dependency environments, the installation fails because better-ajv-errors (a transitive dependency via @redocly/respect-core) declares ajv as a peer dependency, but it's not installed or made available by the parent package. This causes the installation to fail when strictPeerDependencies: true is enabled.
To Reproduce
- Create a
pnpm-workspace.yamlwithstrictPeerDependencies: true - Add
@redocly/clias a dependency to a workspace package - Run
pnpm installwith strict peer dependency checking enabled - See the error:
ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies
└─┬ @redocly/cli 1.34.2
└─┬ @redocly/respect-core 1.34.2
└─┬ better-ajv-errors 1.2.0
└── ✕ missing peer ajv@"4.11.8 - 8"
Expected behavior
Installation should succeed with strict peer dependency checking enabled. @redocly/respect-core should add ajv as a dependency to ensure it's available for better-ajv-errors.
Logs
ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies
└─┬ @redocly/cli 1.34.2
└─┬ @redocly/respect-core 1.34.2
└─┬ better-ajv-errors 1.2.0
└── ✕ missing peer ajv@"4.11.8 - 8"
Redocly version(s)*
@redocly/[email protected]
Node.js version(s)
Node.js 22
OS, environment
Docker container and CI environments with strict peer dependency checking
Additional context
This issue occurs in environments where pnpm is configured with strictPeerDependencies: true (a best practice for dependency management). The missing peer dependency prevents automated builds and containerized deployments from succeeding.