-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Upgrade @reach/router to react-router@6 #14619
Comments
…) has a peer-dep on React 16.x which conflicts with PRC’s peer-dep on React 17.x" This reverts commit e3612051ab01bf1dfbdf477f00ef96b0ea8aca47. Storybook has the same issue (storybookjs/storybook#14119, storybookjs/storybook#14619), so if we’re open to using '--legacy-peer-deps' to use Storybook, we can’t justify removing Playroom on anti-'--legacy-peer-deps' grounds.
This issue is potentially a bigger problem for users of npm v7 than v6. I get the following error on running
|
Another npm 7 user here, getting the same issue as above. Not sure if things will break if I force an install. I've had to jump through many hoops just get Storybook working with Gatsby v3, then it recently stopped working again for unknown reasons, and I can't even do a proper clean install now because of this issue. |
I don't think anything will break if you force the install, it will just behave as if you were using npm 6, which only printed warnings. |
I'm running into this same problem as well. I have a Rush mono-repo that uses pnpm as the package manager and I'm trying to upgrade to React 17. pnpm fails to install packages because the peer dependency requirement is not being met:
I don't want to disable this strict-peer-dependency setting for the package manager, because it's a helpful tool to ensure that the packages in the repo are in a sane state. Will this issue be fixed soon? |
Unfortunately I think both reach router and react-router aren't getting much love right now as the lead maintainers are heads-down on building a new paid framework, remix. I'm hopeful that they'll come back up for air at some point and give some love to the routers, but for now it seems like we're in a holding pattern. I wonder if the best thing might be to fork reach router (and create-react-context) for now and update the peer-deps. What do you think, @shilman? |
IMO the best thing to do short term is to do a storybook org fork of reach with react 17 support, and to follow up with that, move back over to react router at the latest version. I was planning to do the former, but have been slammed at work. |
Seems to me that reach-router is dead. I'd love it if somebody could upgrade to react-router (or a suitable alternative?!) 🙏 |
Having issues using storybook with yarn 2 because of this. ...component-repo provides react@npm:17.0.2 with version 17.0.2, which doesn't satisfy the following requirements:
➤ YN0000: @reach/router@npm:1.3.4 [7db54] → 15.x || 16.x || 16.4.0-alpha.0911da3 ✘
➤ YN0000: @storybook/addon-actions@npm:6.3.4 [a5f0f] → ^16.8.0 || ^17.0.0 ✓
➤ YN0000: @storybook/api@npm:6.3.4 [d5c86] → ^16.8.0 || ^17.0.0 ✓
➤ YN0000: @storybook/client-api@npm:6.3.4 [d5c86] → ^16.8.0 || ^17.0.0 ✓
➤ YN0000: @storybook/components@npm:6.3.4 [d5c86] → ^16.8.0 || ^17.0.0 ✓
➤ YN0000: @storybook/router@npm:6.3.4 [7db54] → ^16.8.0 || ^17.0.0 ✓
➤ YN0000: @storybook/theming@npm:6.3.4 [d5c86] → ^16.8.0 || ^17.0.0 ✓ and $ yarn why @reach/router
├─ @storybook/api@npm:5.3.21
│ └─ @reach/router@npm:1.3.4 (via npm:^1.2.1)
│
├─ @storybook/api@npm:6.2.9
│ └─ @reach/router@npm:1.3.4 (via npm:^1.3.4)
│
├─ @storybook/api@npm:6.3.4
│ └─ @reach/router@npm:1.3.4 (via npm:^1.3.4)
│
├─ @storybook/api@npm:5.3.21 [25072]
│ └─ @reach/router@npm:1.3.4 [7db54] (via npm:^1.3.4 [7db54])
│
├─ @storybook/api@npm:6.2.9 [ab6be]
│ └─ @reach/router@npm:1.3.4 [7db54] (via npm:^1.3.4 [7db54])
│
├─ @storybook/api@npm:5.3.21 [c440d]
│ └─ @reach/router@npm:1.3.4 [0647a] (via npm:^1.2.1 [0647a])
│
├─ @storybook/api@npm:6.3.4 [d5c86]
│ └─ @reach/router@npm:1.3.4 [7db54] (via npm:^1.3.4 [7db54])
│
├─ @storybook/router@npm:5.3.21
│ └─ @reach/router@npm:1.3.4 (via npm:^1.2.1)
│
├─ @storybook/router@npm:6.2.9
│ └─ @reach/router@npm:1.3.4 (via npm:^1.3.4)
│
├─ @storybook/router@npm:6.3.4
│ └─ @reach/router@npm:1.3.4 (via npm:^1.3.4)
│
├─ @storybook/router@npm:5.3.21 [0647a]
│ └─ @reach/router@npm:1.3.4 [0647a] (via npm:^1.2.1 [0647a])
│
├─ @storybook/router@npm:5.3.21 [25072]
│ └─ @reach/router@npm:1.3.4 [7db54] (via npm:^1.3.4 [7db54])
│
├─ @storybook/router@npm:6.3.4 [7db54]
│ └─ @reach/router@npm:1.3.4 [7db54] (via npm:^1.3.4 [7db54])
│
└─ @storybook/router@npm:6.2.9 [a6752]
└─ @reach/router@npm:1.3.4 [7db54] (via npm:^1.3.4 [7db54]) Reach-router still depending on a react 16 peerDependency is giving people using Storybook issues. |
going to attempt to migrate to react-router |
All right, I think I've done, it PR is open. see above. Would be amazing to get some 👀 on it from multiple people! |
w00t!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.4.0-beta.20 containing PR #16440 that references this issue. Upgrade today to the
Closing this issue. Please re-open if you think there's still more to do. |
Issue moves on to @storybook/preset-create-react-app version, after installing the Prerelease. So not fixed for React projects, yet. |
Storybook uses reach/router in a few critical place places. Reach router is EOL, and unfortunately not receving much attention today (like react 17 support for the time being).
The long term path forward for reach/router is react-router6. The short term path forward is react 17 support for reach.
I attempted to start a PR to port over to react-router6, but unfortunately after a few hours determined its a bit more involved than I am capable with the context I currently posses (subtle changes like
navigate
coming from a hook instead of an export now, type changes and the use of definitely typed, existing storybook workarounds and wrappers for reach/router etc).I'm opening this issue to raise awareness of upstream changes that will probably need to be addressed here at some point.
Relavant links:
The text was updated successfully, but these errors were encountered: