storybookjs / presets

🧩 Presets for Storybook
MIT License
426 stars 104 forks source link

@storybook/preset-create-react-app 4.0.1 breaks Storybook #237

Open totszwai opened 2 years ago

totszwai commented 2 years ago

I mainly upgraded/added that preset because Storybook is telling people to add it...

WARN Storybook support for Create React App is now a separate preset. WARN To use the new preset, install @storybook/preset-create-react-app and add it to the list of addons in your .storybook/main.js config file. WARN The built-in preset has been disabled in Storybook 6.0.

Just upgraded to the latest 4.0.1 and Storybook won't load... it just show the spinning icon with no real helpful error messages...

Version 3.2.0 works, but I don't want to use that version because I need react-docgen-typescript@2.2.0...

$ npm ls react-docgen-typescript
@gravity/language@0.4.1 /home/eto/projects/gravity/ui-common/packages/gravity-lang
├─┬ @storybook/preset-create-react-app@3.2.0
│ └─┬ react-docgen-typescript-plugin@1.0.0
│   └── react-docgen-typescript@1.22.0 
└─┬ @storybook/react@6.4.19
  └─┬ @storybook/react-docgen-typescript-plugin@1.0.2-canary.253f8c1.0
    └── react-docgen-typescript@2.2.2 

image

Storybook itself compiles fine with no errors.

image
ronderksen commented 2 years ago

I had the same issue, couldn't find a way to solve it except reverting version to v3.2.0.

dpehrson commented 2 years ago

Just ran into this myself while doing regular dependency update maintenance on a codebase. Even 4.0.0 seems to cause this problem. Opted to just stay on 3.2.0.

nosovsh commented 2 years ago

confirming, the same problem. Reverting to 3.2.0 helps

mateuszpigula commented 2 years ago

In my case this solution worked:

yarn add -D @storybook/builder-webpack5
yarn add -D @storybook/manager-webpack5

bump react-scripts to version ^5.0.1 and adding this to storybook/main.js:

  core: {
    builder: 'webpack5',
  },