Update to work with React 17.?
Describe the bug Unable to install on React 17
⚠️ Make a Codesandbox ⚠️ N/A
To Reproduce Steps to reproduce the behavior:
- Create react 17 project
- try installing use-http
- See error
`
npm install use-http npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: [email protected] npm ERR! Found: [email protected] 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.13.1" from [email protected] npm ERR! node_modules/use-http npm ERR! use-http@"*" 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 C:\Users????\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in: `
Expected behavior Use-http should install.
Are you using npm or yarn?
Hiya,
We are using npm.
Looks like it's a conflict between another package that requires react 17 and use-http, if I just spin up a new project with react 17 and use-http they install ok, but with the other package that requires 17 it won't install use-http as use http requires a peer of react 16.
I'm seeing the issue that @sgtwilko describes as well. @alex-cory Would you accept a PR that bumps the peer dependencies up to 17?
@ryross we dropped npm down one major version, which solved it for us short term.
I'm seeing the issue that @sgtwilko describes as well. @alex-cory Would you accept a PR that bumps the peer dependencies up to 17?
@alex-cory Any chance of implementing the suggestion by @ryross? npm 7+ now requires a version number to be specified, so we are going to see more and more broken builds as people upgrade.
Here's my PR: https://github.com/ava/use-http/pull/317
Thank you!
Should be fixed in v1.0.17
@alex-cory Unfortunately this is still not working because it has a dependency on alex-cory/urs which also needs updating to support react 17. I am guessing use-ssr similarly needs updating.
PR for urs here: https://github.com/alex-cory/urs/pull/8 PR for use-ssr here: https://github.com/alex-cory/use-ssr/pull/36 And once those are done, here's the PR for use-http: https://github.com/ava/use-http/pull/318
Will get to this asap. Most likely tomorrow
Hi @alex-cory. I am currently blocked on this, what would be the best way for me to help get this over the line? :)
Hi @alex-cory. I am currently blocked on this, what would be the best way for me to help get this over the line? :)
@DannyBrown - try taking a looking at https://github.com/vercel/swr - I ended up switching to it and seems to be maintained a bit more regularly.
Publishing the other modules now
Closing. Let me know if there are any more issues regarding this.