Aysha Hamna
Aysha Hamna

Reputation: 446

React Storybook blank page when run

I am trying to load the demo storybook stories. I created a react app using create-react-app and run npm start. It starts on port: 3000. Then when I run npm run storybook, it opens a browser on port:6006. But displays a blank page only.

Upvotes: 6

Views: 7960

Answers (6)

trainoasis
trainoasis

Reputation: 6720

My problem was because I updated @storybook/preset-create-react-app too and it seems I shouldn't have.

When @storybook/preset-create-react-app was reverted back to initial version 3.2.0 in my case, and @storybook/react updated to latest ^6.5.4 - everything was fine.

Upvotes: 0

guipace
guipace

Reputation: 1

npm ci saved the day for me and fixed the issue

Upvotes: 0

mstoJS
mstoJS

Reputation: 154

Try to clear your browser cache. It resolved my issue.

Upvotes: 0

U.A
U.A

Reputation: 3383

If you wanna stay on react version 17 then you could upgrade storybook to prelease by doing

npx sb@next upgrade --prerelease

for additional information please refer GitHub issue #12408

Upvotes: 1

Abacus
Abacus

Reputation: 19471

What helped me was to run

rm yarn.lock
yarn install

after installing storybook into my project

Upvotes: 5

Beny
Beny

Reputation: 21

Apparently react has upgraded to version 17.0.0, but storybook hasn't made the switch yet. If you take version 16.14.0 of react it should work.

https://www.youtube.com/watch?v=fjb_QcQhRrs

Upvotes: 2

Related Questions