Add support for React 18
Closed this issue · 2 comments
timgcarlson commented
Description
It looks like this addon cannot run in a project using React 18. It would be great to get this updated so that stories can be localized using react-intl.
Environment Info
Binaries:
Node: 16.13.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - C:\Program Files\nodejs\yarn.CMD
npm: 8.13.2 - C:\Program Files\nodejs\npm.CMD
npmPackages:
@storybook/react: 6.5.9 => 6.5.9
react: ^18.2.0 => 18.2.0
react-dom: ^18.2.0 => 18.2.0
react-intl: ^6.0.5 => 6.0.5
Repro Steps
- Create a new React project using the latest version (18.2.0)
- install react-intl:
npm i react-intl
- install storybook-react-intl:
npm i -D storybook-react-intl
Expected Result
Should be able to use the addon by following the steps in the README
Actual Result
The module fails to install with the following output
$ npm i -D storybook-react-intl
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: <name>@<version>
npm ERR! Found: react@18.2.0
npm ERR! node_modules/react
npm ERR! react@"^18.2.0" from the root project
npm ERR! peer react@"^16.8.0 || ^17.0.0 || ^18.0.0" from @storybook/addons@6.5.9
npm ERR! node_modules/@storybook/addons
npm ERR! peer @storybook/addons@"^6.4.17" from storybook-react-intl@1.0.5
npm ERR! node_modules/storybook-react-intl
npm ERR! dev storybook-react-intl@"*" from the root project
npm ERR! 4 more (react-dom, @storybook/api, @storybook/components, @storybook/theming)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional react@"^16.8.0 || ^17.0.0" from storybook-react-intl@1.0.5
npm ERR! node_modules/storybook-react-intl
npm ERR! dev storybook-react-intl@"*" 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:\...\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:\...\AppData\Local\npm-cache\_logs\2022-07-08T20_57_25_560Z-debug-0.log
Workaround
Can install it with --force
, but this would require using it on all future uses of npm i
, which is not ideal.
stevensacks commented
@timgcarlson Sorry for the delay. This has been released in version 1.1.1. Please let me know if you have any issues.
timgcarlson commented
Everything is working on my end. Thanks for getting this updated so quickly. Storybook with this plugin will be a game changer for my team!