Skip to content

Fix Storybook 10 build: complete v7→v10 migration#3007

Merged
llastflowers merged 5 commits intocopilot/66837132510-fix-github-actions-workflowfrom
copilot/fix-github-actions-workflow-one-more-time
Mar 12, 2026
Merged

Fix Storybook 10 build: complete v7→v10 migration#3007
llastflowers merged 5 commits intocopilot/66837132510-fix-github-actions-workflowfrom
copilot/fix-github-actions-workflow-one-more-time

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 12, 2026

The "Deploy preview / Build" CI job was failing because storybook CLI was upgraded to v10 while all framework/addon packages remained at v7, causing cascading incompatibilities.

Root causes

  • Manager build: v7 @storybook/docs-toolsdoctrinerequire('assert') (Node built-in), unresolvable by esbuild for browser
  • Framework mismatch: @storybook/react-webpack5@7 API-incompatible with storybook@10
  • Missing compilers: Storybook 10 requires explicit Babel (@storybook/addon-webpack5-compiler-babel) and MDX (@storybook/addon-docs) addons — no longer bundled
  • Broken compat shims: @storybook/manager-api@8 and @storybook/theming@8 shims reference storybook/internal/manager-api which was removed in v10

Changes

docs/package.json

  • Upgrade @storybook/react-webpack5^10.2.17
  • Upgrade storybook-addon-pseudo-states^10.2.17
  • Add @storybook/addon-docs@^10.2.17, @storybook/addon-webpack5-compiler-babel@^4.0.0
  • Add @babel/preset-react, sass-loader, css-loader, style-loader as explicit deps
  • Add @storybook/manager-api, @storybook/theming, @storybook/components v8 compat shims
  • Remove: @storybook/addon-essentials, @storybook/addon-interactions, @storybook/addon-links, @storybook/addon-styling, @storybook/addon-storysource, @storybook/blocks@7, @storybook/react@7, @storybook/testing-library
  • Add postinstall hook to run shim fix script

docs/.storybook/main.js

  • Replace @storybook/addon-styling with explicit webpackFinal SCSS config
  • Register @storybook/addon-webpack5-compiler-babel and @storybook/addon-docs
  • Add webpack alias: @storybook/blocks@storybook/addon-docs/blocks

docs/.storybook/manager.js / theme.js

  • Update imports: @storybook/manager-apistorybook/manager-api, @storybook/themingstorybook/theming

docs/scripts/fix-storybook-shims.mjs (new)

  • Postinstall script that patches @storybook/manager-api and @storybook/theming v8 shims to reference the correct storybook 10 public paths (storybook/manager-api, storybook/theming) instead of the removed internal paths

What should reviewers focus on?

The postinstall shim-patching approach (docs/scripts/fix-storybook-shims.mjs) is the most unusual part. It's needed because @geometricpanda/storybook-addon-badges@2.x (used by deprecated-component stories) has no storybook 10 release and its v8 compat shims are broken for v10. The script patches two files in node_modules after install — fragile by nature, but the only option short of removing badge support from ~16 story files or forking the addon.

@storybook/blocks@8.6.14 is kept as a dep alongside @storybook/addon-docs@10 because the former is used directly in MDX story imports; the webpack alias redirects those imports to the v10-compatible implementation at build time.

Can these changes ship as is?

  • Yes, this PR does not depend on additional changes. 🚢

Copilot AI and others added 4 commits March 12, 2026 18:23
Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com>
… fix compat shims

Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com>
…an up shim script

Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 12, 2026

⚠️ No Changeset found

Latest commit: 9c62235

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

…ts (#3008)

* Initial plan

* fix: resolve storybook peer dependency conflicts in docs install

- Update @geometricpanda/storybook-addon-badges to ^2.0.5 which supports @storybook/blocks@^8.3.0 (v2.0.0 only supported ^7.0.0)
- Add docs/.npmrc with legacy-peer-deps=true to handle the intentional mixed storybook 8/10 package setup used by shims and webpack aliases

Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com>
@github-actions github-actions Bot temporarily deployed to Storybook Preview March 12, 2026 20:15 Inactive
@llastflowers llastflowers marked this pull request as ready for review March 12, 2026 20:15
@llastflowers llastflowers requested review from a team as code owners March 12, 2026 20:15
@llastflowers llastflowers merged commit c0daf21 into copilot/66837132510-fix-github-actions-workflow Mar 12, 2026
17 of 18 checks passed
@llastflowers llastflowers deleted the copilot/fix-github-actions-workflow-one-more-time branch March 12, 2026 20:15
llastflowers added a commit that referenced this pull request Mar 12, 2026
* Initial plan

* Fix ESM compatibility: replace require('sass') with ESM import in main.js

Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com>

* Fix Storybook 10 build: complete v7→v10 migration (#3007)

* Initial plan

* Initial plan for fixing storybook build failures

Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com>

* Fix Storybook 10 build: update packages, add SCSS/Babel/docs support, fix compat shims

Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com>

* Address code review: remove unused assert dep, rename config var, clean up shim script

Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com>

* Fix docs npm install failure due to storybook peer dependency conflicts (#3008)

* Initial plan

* fix: resolve storybook peer dependency conflicts in docs install

- Update @geometricpanda/storybook-addon-badges to ^2.0.5 which supports @storybook/blocks@^8.3.0 (v2.0.0 only supported ^7.0.0)
- Add docs/.npmrc with legacy-peer-deps=true to handle the intentional mixed storybook 8/10 package setup used by shims and webpack aliases

Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com>
llastflowers added a commit that referenced this pull request Mar 12, 2026
…ybook script (#3004)

* Bump tar and storybook in /docs

Removes [tar](https://github.com/isaacs/node-tar). It's no longer used after updating ancestor dependency [storybook](https://github.com/storybookjs/storybook/tree/HEAD/code/core). These dependencies need to be updated together.


Removes `tar`

Updates `storybook` from 7.6.21 to 10.2.17
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v10.2.17/code/core)

---
updated-dependencies:
- dependency-name: tar
  dependency-version: 
  dependency-type: indirect
- dependency-name: storybook
  dependency-version: 10.2.17
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Initial plan

* Fix storybook build: remove invalid positional argument `public/static`

Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com>

* Fix ESM compatibility in .storybook/main.js (#3005)

* Initial plan

* Fix ESM compatibility: replace require('sass') with ESM import in main.js

Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com>

* Fix Storybook 10 build: complete v7→v10 migration (#3007)

* Initial plan

* Initial plan for fixing storybook build failures

Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com>

* Fix Storybook 10 build: update packages, add SCSS/Babel/docs support, fix compat shims

Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com>

* Address code review: remove unused assert dep, rename config var, clean up shim script

Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com>

* Fix docs npm install failure due to storybook peer dependency conflicts (#3008)

* Initial plan

* fix: resolve storybook peer dependency conflicts in docs install

- Update @geometricpanda/storybook-addon-badges to ^2.0.5 which supports @storybook/blocks@^8.3.0 (v2.0.0 only supported ^7.0.0)
- Add docs/.npmrc with legacy-peer-deps=true to handle the intentional mixed storybook 8/10 package setup used by shims and webpack aliases

Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com>

* fix: regenerate docs/package-lock.json to resolve storybook binary not found (#3009)

* Initial plan

* fix: regenerate docs/package-lock.json to fix storybook binary not found

Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: llastflowers <55068883+llastflowers@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants