Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/dirty-cases-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@pnpm/resolve-dependencies": patch
"pnpm": patch
---

Don't fail on `pnpm add`, when `blockExoticSubdeps` is set to `true` [#10324](https://github.com/pnpm/pnpm/issues/10324).
Binary file not shown.
7 changes: 4 additions & 3 deletions pkg-manager/resolve-dependencies/src/resolveDependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,8 @@ async function resolveDependency (
if (
ctx.blockExoticSubdeps &&
options.currentDepth > 0 &&
!isNonExoticDep(pkgResponse.body.resolvedVia)
pkgResponse.body.resolvedVia != null && // This is already coming from the lockfile, we skip the check in this case for now. Should be fixed later.
isExoticDep(pkgResponse.body.resolvedVia)
) {
const error = new PnpmError(
'EXOTIC_SUBDEP',
Expand Down Expand Up @@ -1807,6 +1808,6 @@ const NON_EXOTIC_RESOLVED_VIA = new Set([
'workspace',
])

function isNonExoticDep (resolvedVia: string | undefined): boolean {
return resolvedVia != null && NON_EXOTIC_RESOLVED_VIA.has(resolvedVia)
function isExoticDep (resolvedVia: string): boolean {
return !NON_EXOTIC_RESOLVED_VIA.has(resolvedVia)
}
Loading