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

fix: storybook occurred an unexpected error when starting #268

Merged
merged 1 commit into from
Aug 13, 2023

Conversation

ttpss930141011
Copy link
Contributor

@ttpss930141011 ttpss930141011 commented Aug 13, 2023

Why need this change

  • An unexpected error occurred while storybook was starting.
Previous Current
螢幕擷取畫面 2023-08-13 143718 image

Root cause

Changes made

  • Update @storybook/addon-essentials from version 7.0.23 to 7.2.3
  • Update @storybook/addon-interactions from version 7.0.23 to 7.2.3
  • Update @storybook/addon-links from version 7.0.23 to 7.2.3
  • Update @storybook/blocks from version 7.0.23 to 7.2.3
  • Update @storybook/nextjs from version 7.0.23 to 7.2.3
  • Update @storybook/react from version 7.0.23 to 7.2.3
  • Update storybook from version 7.0.23 to 7.2.3

Test Scope / Change impact

Issue

Note

前幾日 @bxbdev 找我討論在升級 yarn 3 後 Storybook 壞掉的問題,我想問題是出在 Next.js 版本更新導致 Storybook 無法使用,不是升級 yarn 的問題。

有趣的是,在修復了 Storybook 之後準備 commit 時在 Hasky 出現錯誤,錯誤訊息如此 issue,Storybook 的成員猜想這或許是 yarn 1 的問題,並且不知道原因。他提出了兩種解法:

  1. So a simple workaround is to fix the resolution of jackspeak to 2.1.1:
  "resolutions": {
    "jackspeak": "2.1.1"
  }
  1. I'll note another workaround is to simply not use yarn 1 🤷

但最後我只有將 node_modules 砍掉,重新 yarn 一次錯誤變消失了,這點還要後續追蹤看看會不會有其它問題。

更新:

在 CI install dependencies 時出了一樣的錯,之後在 package.json 依建議增加了 resolutions 後暫時解決了問題。

image

但隨著越來越多的 package 試圖通過提供混合esm/cjs 支持來逐步進入 esm 支持,也許在未來放棄 cjs 支持的 package 會越來越多,升級 yarn 或許是未來可以討論的選項之一。

@ttpss930141011 ttpss930141011 linked an issue Aug 13, 2023 that may be closed by this pull request
@vercel
Copy link

vercel bot commented Aug 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
game-lobby-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 13, 2023 1:32pm

@ttpss930141011 ttpss930141011 self-assigned this Aug 13, 2023
@ttpss930141011 ttpss930141011 added bug Fix something in main don't merge labels Aug 13, 2023
@ttpss930141011 ttpss930141011 force-pushed the chore/upgrade-storybook-version branch from 41fb92b to 68cb242 Compare August 13, 2023 08:18
@ttpss930141011 ttpss930141011 changed the title chore: update Storybook packages to version 7.2.3 fix: update Storybook packages to version 7.2.3 Aug 13, 2023
- Update `@storybook/addon-essentials` from version `7.0.23` to `7.2.3`
- Update `@storybook/addon-interactions` from version `7.0.23` to `7.2.3`
- Update `@storybook/addon-links` from version `7.0.23` to `7.2.3`
- Update `@storybook/blocks` from version `7.0.23` to `7.2.3`
- Update `@storybook/nextjs` from version `7.0.23` to `7.2.3`
- Update `@storybook/react` from version `7.0.23` to `7.2.3`
- Update `storybook` from version `7.0.23` to `7.2.3`
@ttpss930141011 ttpss930141011 force-pushed the chore/upgrade-storybook-version branch from 68cb242 to 02e2bb4 Compare August 13, 2023 13:29
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@GaaSBot
Copy link

GaaSBot commented Aug 13, 2023

Knip Scan Result for 02e2bb4

Unused files (10)
Unused files (10)
.bundlewatch.config.js
components/shared/Chat/ChatContent.tsx
components/shared/Chat/ChatMessage.tsx
components/shared/Chat/index.tsx
components/shared/Icon/group/news.tsx
configs/i18nConfigs.ts
lighthouserc.js
reset.d.ts
scripts/knipScanReporter.js
scripts/lhciScanReporter.js
Unused dependencies (2)
Unused dependencies (2)
@svgr/webpack package.json
sharp package.json
Unused devDependencies (5)
Unused devDependencies (5)
@actions/github package.json
@octokit/core package.json
@storybook/blocks package.json
@storybook/testing-library package.json
@total-typescript/ts-reset package.json
Configuration issues (1)
Configuration issues (1)
Unused item in ignoreDependencies: @next/bundle-analyzer

@GaaSBot
Copy link

GaaSBot commented Aug 13, 2023

🤖 Lighthouse Scan Result for 02e2bb4

/rooms
Metric Value
Performance 62
Seo 80
Accessibility 79
HTML Report for LHCI Scan Report Link
/rooms/abc
Metric Value
Performance 74
Seo 80
Accessibility 69
HTML Report for LHCI Scan Report Link
/login
Metric Value
Performance 49
Seo 80
Accessibility 97
HTML Report for LHCI Scan Report Link

@Yuwen-ctw Yuwen-ctw merged commit 1f644f9 into main Aug 13, 2023
@Yuwen-ctw Yuwen-ctw deleted the chore/upgrade-storybook-version branch August 13, 2023 13:35
@ttpss930141011 ttpss930141011 changed the title fix: update Storybook packages to version 7.2.3 fix: storybook occurred an unexpected error when starting Aug 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fix something in main
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix: storybook 啟用時出現預期外的錯誤
3 participants