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

@storybook/builder-webpack5 doesn't allow React 18 #17962

Closed
DoneDeal0 opened this issue Apr 14, 2022 · 7 comments
Closed

@storybook/builder-webpack5 doesn't allow React 18 #17962

DoneDeal0 opened this issue Apr 14, 2022 · 7 comments

Comments

@DoneDeal0
Copy link

DoneDeal0 commented Apr 14, 2022

I can't install @storybook/builder-webpack5 with npm because of a dependency error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: my-app@1.0.0
npm ERR! Found: react@18.0.0
npm ERR! node_modules/react
npm ERR!   react@"^18.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0 || ^17.0.0" from @storybook/builder-webpack5@6.4.22
npm ERR! node_modules/@storybook/builder-webpack5
npm ERR!   dev @storybook/builder-webpack5@"^6.4.21" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry

It works with yarn install though.

Could you allow React 18?

EDIT: I see that react 18 is already allowed as a peer dependency in https://github.com/storybookjs/storybook/blob/next/lib/builder-webpack5/package.json . It's really weird.

@reneaaron
Copy link

I just had the same issue. While installation didn't work with npm install it did work with yarn install 🤷‍♂️

@shilman shilman added react yarn / npm Yarn / npm acting weird dependencies labels Apr 17, 2022
@TodBob
Copy link

TodBob commented Apr 19, 2022

Same issue

@valentinpalkovic
Copy link
Contributor

valentinpalkovic commented Apr 19, 2022

@DoneDeal0 My assumption is, that you are not using the latest prerelease version of storybook (npx sb@next upgrade --prerelease). React 18's concurrent mode is not working with 6.4.x versions of storybook.

@usageness
Copy link

I had same issue with same version of storybook.

@shilman
Copy link
Member

shilman commented Apr 29, 2022

Try upgrading to the latest prerelease:

npx sb@next upgrade --prerelease

@nick-bull
Copy link

Specifying a higher version worked for me:

npm i -D @storybook/builder-webpack5@6.5.0-beta.4

@ndelangen
Copy link
Member

This has been fixed in storybook 7.0 beta

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

No branches or pull requests

8 participants