use-http icon indicating copy to clipboard operation
use-http copied to clipboard

Update to work with React 17.?

Open sgtwilko opened this issue 6 years ago • 12 comments

Describe the bug Unable to install on React 17

⚠️ Make a Codesandbox ⚠️ N/A

To Reproduce Steps to reproduce the behavior:

  1. Create react 17 project
  2. try installing use-http
  3. 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.

sgtwilko avatar Nov 16 '20 16:11 sgtwilko

Are you using npm or yarn?

iamthesiz avatar Nov 16 '20 21:11 iamthesiz

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.

sgtwilko avatar Nov 17 '20 09:11 sgtwilko

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 avatar Dec 09 '20 06:12 ryross

@ryross we dropped npm down one major version, which solved it for us short term.

sgtwilko avatar Dec 09 '20 09:12 sgtwilko

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!

romiem avatar Mar 03 '21 18:03 romiem

Should be fixed in v1.0.17

iamthesiz avatar Mar 03 '21 23:03 iamthesiz

@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

romiem avatar Mar 04 '21 09:03 romiem

Will get to this asap. Most likely tomorrow

iamthesiz avatar Mar 04 '21 15:03 iamthesiz

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-xx avatar Mar 08 '21 12:03 DannyBrown-xx

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.

romiem avatar Mar 08 '21 12:03 romiem

Publishing the other modules now

iamthesiz avatar Mar 08 '21 16:03 iamthesiz

Closing. Let me know if there are any more issues regarding this.

iamthesiz avatar Mar 09 '21 20:03 iamthesiz