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 preview with uncaught error #831

Closed
tianenpang opened this issue May 13, 2022 · 3 comments
Closed

Storybook preview with uncaught error #831

tianenpang opened this issue May 13, 2022 · 3 comments
Labels
bug Something isn't working build

Comments

@tianenpang
Copy link
Contributor

Which Component 出现bug的组件

  • storybook

semi-ui version

  • latest

Expected result 期望的结果是什么

  • running and previewing the storybook properly

Actual result 实际的结果是什么

  • Uncaught Error: Singleton client API not yet initialized, cannot call addParameters.

Steps to reproduce 复现步骤

  • following the contribution guidelines
    • git clone https://github.com/<your-username>/semi-design.git
    • cd semi-design
    • git checkout -b <TOPIC_BRANCH_NAME>
    • yarn global add lerna
    • npm run bootstrap
    • npm start
  • open the storybook at http://127.0.0.1:6006 and checkout the console

Reproducible code 复现代码

  • follow the Steps to reproduce 复现步骤 above

Additional information 补充说明

  • system environment info
System:
  OS: Windows 10 10.0.19044
Binaries:
  Node: 16.15.0
  Yarn: 1.22.18
  npm: 8.5.5
  lerna: 4.0.0
Browsers:
  Chrome: 101.0.4951.67 (Official Build) (64-bit)
  • screenshot of the error message in console

screenshot

@tianenpang tianenpang added the bug Something isn't working label May 13, 2022
@pointhalo
Copy link
Collaborator

get,稍后按照你的步骤我试一下

@pointhalo
Copy link
Collaborator

pointhalo commented May 13, 2022

复现不了,构建过程正常,访问 localhost:6006也正常。基本上把所有依赖都切到跟你一样的version了
image

我只能怀疑是mac和windows下有些不太一样了。

另外找到一个同类的反馈 storybookjs/storybook#10887
我查看了下yarn.lock,我们项目里确实会存在 两个版本的 @storybook/client-api,但因为我本地无法复现,所以我现在无法确定统一版本是否能解决你这边无法运行的问题,你方便的话,麻烦帮我们试验一下❤️

  1. pacakge.json 锁一下 版本
  "resolutions": {
     "@storybook/client-api": "6.5.0-beta.1"
  },
  1. rm -rf node_modules 、再删一下 yarn.lock
  2. npm run bootstrap
  3. npm start

@tianenpang
Copy link
Contributor Author

If using Git Bash in Windows the path needs to be strictly case-sensitive.

@pointhalo thanks for your screenshot that brought the case warning to my attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build
Projects
None yet
Development

No branches or pull requests

2 participants