Skip to content

fix: don't crash when auto-install-peers is true in a workspace#5467

Merged
zkochan merged 5 commits into
mainfrom
fix/5454
Oct 9, 2022
Merged

fix: don't crash when auto-install-peers is true in a workspace#5467
zkochan merged 5 commits into
mainfrom
fix/5454

Conversation

@zkochan

@zkochan zkochan commented Oct 8, 2022

Copy link
Copy Markdown
Member

close #5454

@zkochan zkochan marked this pull request as ready for review October 9, 2022 00:35
@zkochan zkochan merged commit 84f4404 into main Oct 9, 2022
@zkochan zkochan deleted the fix/5454 branch October 9, 2022 01:29
@zkochan zkochan added this to the v7.13 milestone Oct 9, 2022
zkochan pushed a commit that referenced this pull request Jun 20, 2026
… resolution order (#12514)

claimChildrenResolution let a non-owner occurrence of a shared package reuse the
owner's missingPeersOfChildren when `existing.owner.depth >= currentDepth ||
existing.missingPeersOfChildren.resolved`. The second clause made reuse depend on
whether the owner's resolution had settled by claim time. Under concurrent
resolution that timing varies run to run, so a deeper consumer inherited the
owner's missing peers on some runs but not others — flipping an optional
transitive peer (e.g. `@babel/core`, reached via styled-jsx) in and out of a
package's resolved peer suffix and churning the lockfile, with intermittent
`pnpm dedupe --check` failures in CI.

Drop the `.resolved` clause: reuse only when the owner is at the same or a deeper
depth, a function of the dependency graph rather than completion order.

The `.resolved` flag was introduced in #5467 (closing #5454) to
avoid a deadlock where, with auto-install-peers in a workspace, a shared package
awaited its own not-yet-settled missingPeersOfChildren promise. Removing the
clause is strictly more conservative — a shallower owner's promise is never
reused, settled or not, so no unsettled promise is ever awaited and the deadlock
cannot return. The #5454 regression test still passes, as do the peer,
dedupe, and cyclic suites. The deterministic owner selection from #12362
made shared-package ownership order-independent but had moved this timing branch
in verbatim without neutralizing it.

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Installation in monorepos is not working since 7.11

1 participant