admin管理员组文章数量:1245898
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.
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.
- It is rather difficult to help if you provide next to nothing in the way of details. Are there any errors logged in the console? Can you provide your package.json file? – Drew Reese Commented Oct 21, 2020 at 8:11
- 1 there are no errors. It just displays a blank page in the browser. and not the demo storybook stories – Aysha Hamna Commented Oct 21, 2020 at 10:39
- I think there are some errors , open the developer console , I have same problem and it has some problem with React Hooks , – MBehtemam Commented Oct 24, 2020 at 10:06
6 Answers
Reset to default 5What helped me was to run
rm yarn.lock
yarn install
after installing storybook into my project
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./watch?v=fjb_QcQhRrs
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
Try to clear your browser cache. It resolved my issue.
npm ci
saved the day for me and fixed the issue
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.
本文标签: javascriptReact Storybook blank page when runStack Overflow
版权声明:本文标题:javascript - React Storybook blank page when run - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1740252685a2248792.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论