Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release new version compatible with React 17 #429

Open
alexandernst opened this issue Oct 24, 2020 · 19 comments · May be fixed by #436
Open

Release new version compatible with React 17 #429

alexandernst opened this issue Oct 24, 2020 · 19 comments · May be fixed by #436

Comments

@alexandernst
Copy link

React 17 was just released. There are no breaking changes, but if I try to use it with this package, I get warnings about missing peer-dependencies (this package depends on [email protected]).

Can you release a new version making this package compatible with React 17? @blainekasten

@alexandernst
Copy link
Author

I'll gladly create a MR if you're willing to merge it and release a new version :)

@alexandernst
Copy link
Author

ping @ryanflorence @blainekasten

@blainekasten
Copy link
Collaborator

@alexandernst Yes please, put up a PR and i'll get a version released!

@alexandernst
Copy link
Author

@blainekasten Done! #432

I also changed "create-react-context" to "^0.3.0" as I'll try to push that library to React 17 as well.

haysclark added a commit to haysclark/router that referenced this issue Nov 27, 2020
@haysclark haysclark linked a pull request Nov 27, 2020 that will close this issue
@haysclark
Copy link

@sfcgeorge Wrote a wonderful synopsis about this issue in PR (#432) which I feel should be captured here.

@david-j-davis
Copy link

david-j-davis commented Apr 23, 2021

I'm surprised that this still has not been done at this point in time. For context, anyone using Gatsby, witch has reach router under the hood, cannot use this router at all with React 17. So...?

@haysclark
Copy link

@david-j-davis I hear you. Lots of Gatsby and Storybook users visit this Issue and the related PR's.

For GastbyJS 3.0 users, they can look at this work-around for their Jest tests: https://www.gatsbyjs.com/docs/reference/release-notes/migrating-from-v2-to-v3/#reach-router

@vmalay
Copy link

vmalay commented May 28, 2021

When using NPM v7, you will get an error instead of a warning, which is a bit disturbing. By using Storybook I just can't use npm install because of this issue. Any news or workaround about this ?

@alvis
Copy link

alvis commented Jun 1, 2021

Possibly the only way to get around it with npm7+ for the moment is using the --force or --legacy-peer-deps flag.
Of course, you can use yarn or other similar like pnpm as many have suggested. The idea is the same though -- just ignore peer dependency conflict. Yes. It's like sweeping your rubbish under your carpet and I'm quite against it. But... life as a js developer is predetermined to be very hard... 🤢

@ryanflorence @blainekasten @chaance @cassidoo @marcysutton @mjackson
Are you still be able to help to release a new version if we submit a PR for that?

@Anksus
Copy link

Anksus commented Jun 28, 2021

Nobody working on this issue?

@boillatlucas
Copy link

Can you release a new version making this package compatible with React 17? @blainekasten

@drianoaz
Copy link

This library is currently causing a peer dependency problem with the storybook.

image

@VictorGaiva
Copy link

This library is currently causing a peer dependency problem with the storybook.

image

This issue is already known and has an active PR on storybook's repo

@LaurensUP
Copy link

LaurensUP commented Jul 15, 2021

This issue is already known and has an active PR on storybook's repo

@VictorGaiva This one? storybookjs/storybook#14619

juliusv added a commit to prometheus/prometheus that referenced this issue Aug 30, 2021
We want to upgrade to React 17, but Reach Router does not work with React 17:
reach/router#429

Also, the Reach + React Router projects announced an intention to join forces
and just continue as React Router:
https://reacttraining.com/blog/reach-react-router-future/

Signed-off-by: Julius Volz <[email protected]>
juliusv added a commit to prometheus/prometheus that referenced this issue Aug 30, 2021
We want to upgrade to React 17, but Reach Router does not work with React 17:
reach/router#429

Also, the Reach + React Router projects announced an intention to join forces
and just continue as React Router:
https://reacttraining.com/blog/reach-react-router-future/

Signed-off-by: Julius Volz <[email protected]>
juliusv added a commit to prometheus/prometheus that referenced this issue Aug 30, 2021
We want to upgrade to React 17, but Reach Router does not work with React 17:
reach/router#429

Also, the Reach + React Router projects announced an intention to join forces
and just continue as React Router:
https://reacttraining.com/blog/reach-react-router-future/

Signed-off-by: Julius Volz <[email protected]>
juliusv added a commit to prometheus/prometheus that referenced this issue Aug 30, 2021
We want to upgrade to React 17, but Reach Router does not work with React 17:
reach/router#429

Also, the Reach + React Router projects announced an intention to join forces
and just continue as React Router:
https://reacttraining.com/blog/reach-react-router-future/

Signed-off-by: Julius Volz <[email protected]>
@harshayburadkar
Copy link

Is it possible to make this compatible with React 17, please?

@cduff
Copy link

cduff commented Oct 28, 2021

Node 16 has just moved to LTS which includes npm version 8. Anyone moving to this new node LTS version and using latest versions of react (17) and @reach/router will encounter npm install failures for the first time due to this. So lots of people are about to run into this problem.

PS C:\path> npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: my-project@undefined
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"15.x || 16.x || 16.4.0-alpha.0911da3" from @reach/router@1.3.4
npm ERR! node_modules/@reach/router
npm ERR!   @reach/router@"1.3.4" 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\username\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\username\AppData\Local\npm-cache\_logs\2021-10-28T07_21_28_487Z-debug.log

Is it safe for the time being to just run with --legacy-peer-deps?

@domdomegg
Copy link

If you're hitting this issue with the strict enforcement of legacy peer dependencies, you'll probably get an error that looks like:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: @you/[email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^17.0.2" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"15.x || 16.x || 16.4.0-alpha.0911da3" from @reach/[email protected]
npm ERR! node_modules/@reach/router
npm ERR!   @reach/router@"*" 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.

To fix this properly (i.e. without using --legacy-peer-deps), you can use @gatsbyjs/reach-router instead, which is a drop-in replacement with React 17+ support. The typings have just been added for this module so you can use it in TypeScript projects too.

  1. Uninstall reach router with npm uninstall @reach/router
  2. Install Gatsby version with npm install @gatsbyjs/reach-router
  3. (if using TypeScript) Install typings with npm i @types/gatsbyjs__reach-router
  4. Replace any imports of @reach/router with @gatsbyjs/reach-router in your project

@ivalmian
Copy link

gatsbyjs is now only for React 18, if you're using 17 the problem persists.

@tujoworker
Copy link

@ivalmian You can still use the v1.x for React v17 npm install @gatsbyjs/[email protected] – but like with React v17, you miss out of updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.