Skip to content

Bug: Peer dependency change between use-subscription 1.4.1 and 1.5.0 #20224

Closed
@billyjanitsch

Description

@billyjanitsch

React version: [email protected]

Steps To Reproduce

  1. Run npm install [email protected] [email protected].
  2. Run npm install [email protected]. Note the React peer dependency error.

Notably, this currently affects npm install react@16 next@10 (see vercel/next.js#18518). npm@7 will refuse to perform this installation entirely.

The current behavior

[email protected] peer-depends on react@^16.8.0 whereas [email protected] peer-depends on react@^17.0.0, which is generally considered a breaking change in a minor version. This might have been an oversight in how #20062 interacted with #19373?

(It's considered a breaking change because a package.json like the below should always result in a valid install.)

{
  "dependencies": {
    "react": "^16.14.0",
    "use-subscription": "^1.4.1"
  }
}

The expected behavior

Here are two potential solutions:

  • Cut a release of [email protected] that peer-depends on ^16.8.0 || ^17.0.0, strictly widening the peer dep range from that of 1.4.1.
  • Cut a major release of use-subscription@2 that peer-depends on ^17.0.0, and cut a release of [email protected] that reverts its peer dependency to ^16.8.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions