Visitar URL original
A workspace package stays linked after its peer provider is added under injectWorkspacePackages · Issue #17057 · pnpm/pnpm · GitHub
Skip to content

A workspace package stays linked after its peer provider is added under injectWorkspacePackages #17057

Closed

Description

@zkochan

What happens

A workspace has lib with "peerDependencies": { "@pnpm.e2e/foo": "100" } and injectWorkspacePackages: true.

  1. Project a depends on "lib": "workspace:*" only. pnpm install records lib: link:../lib for a.
  2. Add "@pnpm.e2e/foo": "100.0.0" to a and run pnpm install.

a keeps lib: link:../lib. lib then resolves @pnpm.e2e/foo from its own directory, not from a, so the peer a provides is not the one lib sees.

A fresh install of the final manifests injects it: lib: file:packages/lib(@pnpm.e2e/foo@100.0.0). pnpm dedupe turns the first lockfile into the second. autoDedupe: true does not.

Expected

Once a provides the peer, the second install injects lib with the peer bound, as a fresh install does.

Versions

Reproduced on main with both pnpm v11 and v12, in every combination of autoInstallPeers, dedupePeerDependents, and (v12) autoDedupe.

Found by the peer convergence harness for pnpm/tasks#143 (peer_convergence::workspace_package_with_a_peer).


Written by an agent (Claude Code, claude-opus-5-5).

Activity

  1. github-actions commented on Oct 17, 2026

    @github-actions
    Contributor

    @zkochan, are you planning to open a pull request for this? If so, reply here and a maintainer will assign the issue to you, so nobody else starts on the same fix.

  2. self-assigned this
    on Oct 17, 2026
  3. zkochan commented on Oct 17, 2026

    @zkochan
    MemberAuthor

    #17075 (draft) fixes this in v11 and v12. The kept link: came from the guard added for #10433, which keeps a recorded link: on any install that doesn't target the dependency. With the guard disabled, #10433's update scenario still stays linked in both stacks, because the dedupe pass now covers it. The guard's only remaining effect was this divergence from a fresh install, so the PR removes it.


    Written by an agent (Claude Code, claude-opus-5-5).

  4. added a commit that references this issue on Oct 18, 2026
    0cef240
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions