question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Republish the package with updated peerDependencies 'cause now we have a problem for React 17

See original GitHub issue

Hi! If you look at the current package.json of this package published on NPM: https://unpkg.com/@use-it/event-listener@0.1.6/package.json

{
  ...
  "peerDependencies": {
    "react": "^16.8.0"
  },
  ...
}

You will see that it only peer-depends on React ^16, whereas as React 17 is now released, it should be:

{
  ...
  "peerDependencies": {
    "react": "^16.8.0 || ^17.0.0"
  },
  ...
}

With the current package.json, NPM returns the following error when I run npm update:

$ npm update
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: bluelinks@5.0.0
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   react@"^17.0.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0" from @use-it/event-listener@0.1.6
npm ERR! node_modules/@use-it/event-listener
npm ERR!   @use-it/event-listener@"^0.1.6" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /Users/antony/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/antony/.npm/_logs/2021-02-26T09_51_18_073Z-debug.log

Could you publish the updated package.json file, please? Thank you!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:8
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
edemainecommented, Oct 22, 2021

With NPM 7, working around this requires npm install --force.

Perhaps it would make sense to just have a peer dependency of >=16.8.0? Then this issue will be fixed for the rest of time (until React breaks the package somehow 🙂 ).

0reactions
donavoncommented, Nov 15, 2021

published x0.1.7

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support React 17 · Issue #1616 · bvaughn/react-virtualized
Currently, react-virtualized has a peer dependency on react and react-dom that constraints it to React 16. From my experiments, it already ...
Read more >
How to fix NPM link duplicate dependencies issues
Dealing with dependencies when developing a package and using it through npm link.
Read more >
How do I resolve peer dependency error: The package react ...
it worked when i updated npm "npm install npm -g" and then downgraded react to; "react": "15.3.0" , cleared cache: npm cache clear...
Read more >
npm Peer Dependencies - JavaScript inDepth
Peer Dependencies are used to specify that our package is compatible with a specific version of an npm package. Good examples are Angular...
Read more >
React 17 Compatibility - Material Design for Bootstrap
It kind of supports React 17. I asked a similar question here https://mdbootstrap.com/support/react/install-react-pro-5-0-1/. Using --legacy-peer-deps flag ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found