Skip to content

chore(storybook): upgrade to 10.6.3 for Nx 23 compatibility - #684

Open
Paul Mardling (PaulGMardling) wants to merge 3 commits into
microsoft:mainfrom
PaulGMardling:chore/storybook-nx23-compatibility
Open

Paul Mardling (PaulGMardling) wants to merge 3 commits into
microsoft:mainfrom
PaulGMardling:chore/storybook-nx23-compatibility

Conversation

@PaulGMardling

@PaulGMardling Paul Mardling (PaulGMardling) commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Upgrade Storybook from 9.1.16 to 10.6.3 as a separate prerequisite for the Nx 23 upgrade. Nx remains at 22.7.7 in this PR so the Storybook migration can be reviewed and validated independently.

  • Align Storybook core, the React Webpack framework, docs/themes addons, and CAP theme's pseudo-states addon at 10.6.3. Keep the existing Babel compiler addon at 3.0.6.
  • Use export-aware moduleResolution: "bundler" only in Storybook and React 17/18/19 story-integration configurations. Explicitly retain allowSyntheticDefaultImports: false to preserve the previous import-checking behavior; shared library and Jest settings are unchanged.
  • Include TSX preview files in Storybook type checking, correct the shared Storybook config's base/typing paths, and update the custom generator, its expected output, and contributor guidance.
  • Deduplicate the dependency graph using the repository's yarn run dedupe command to satisfy the CI lockfile check.
  • Add a none Beachball change for the CAP theme's development-only addon update. No component implementation or public API changes are included.

Why a major Storybook update?

Nx 23's build and dev executors dynamically import storybook/internal/core-server. Storybook 9.1.16 works through CommonJS require(), but its ESM entry fails with Dynamic require of "path" is not supported.

The same failure was reproduced with Storybook 9.1.21 on Node 22.23.1 and 24.18.0, so the latest 9.x patch did not resolve the incompatibility. Storybook 10.0.0 and the selected 10.6.3 release expose the build function through both loading paths on those runtimes.

Validation

Local validation of the final deduplicated dependency graph:

  • yarn run dedupe --check --json, yarn install --immutable, yarn check-dependencies, and Beachball checks pass.
  • Nx 22 builds the complete docsite on Node 22.23.1 and CAP Storybook with pseudo-states on Node 24.18.0. Both dev servers start and serve their story indexes.
  • Browser checks pass against both dev servers and static builds served from subpaths: custom Fluent docs, props tables, inline examples, dialog open/close, and pseudo-state styling, with no uncaught browser exceptions.
  • All 22 shared/package Storybook TypeScript configurations and the React 17/18/19 story-integration configurations pass. Negative type probes confirm invalid story args, framework options, and synthetic default imports are still rejected.
  • Nx plugin lint and all 23 tests / 25 snapshots pass.
  • React 17, 18, and 19 integration unit tests each pass 43 suites and 246 tests, with one existing skipped test and four passing snapshots.

The existing integration prerequisite build/type-check targets also passed for 24 projects during the migration. This PR does not upgrade Nx or claim full Nx 23 integration validation; that remains separate work.

Preserve Nx 22 and existing library/Jest settings while migrating Storybook configuration and story integration checks to export-aware module resolution. Retain the previous synthetic-default-import behavior.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 45985d00-bee2-46cc-b076-f90fa40a3cc3
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 45985d00-bee2-46cc-b076-f90fa40a3cc3
Apply the repository's highest-resolution dedupe strategy so the Storybook upgrade satisfies the CI lockfile check.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 45985d00-bee2-46cc-b076-f90fa40a3cc3
@PaulGMardling Paul Mardling (PaulGMardling) changed the title Chore/storybook nx23 compatibility chore(storybook): upgrade to 10.6.3 for Nx 23 compatibility Oct 22, 2026
@PaulGMardling
Paul Mardling (PaulGMardling) marked this pull request as ready for review October 22, 2026 14:16

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant