Skip to content

Fix storybook configuration issue preventing it from running locally#1221

Merged
brentswisher merged 1 commit intodevelopfrom
hotfix/storybook-not-loading-locally
Mar 10, 2026
Merged

Fix storybook configuration issue preventing it from running locally#1221
brentswisher merged 1 commit intodevelopfrom
hotfix/storybook-not-loading-locally

Conversation

@brentswisher
Copy link
Contributor

This change: (check at least one)

  • Adds a new feature
  • Fixes a bug
  • Improves maintainability
  • Improves documentation
  • Is a release activity

Is this a breaking change? (check one)

  • Yes
  • No

Is the: (complete all)

  • Title of this pull request clear, concise, and indicative of the issue number it addresses, if any?
  • Test suite(s) passing?
  • Code coverage maximal?
  • Changeset added?

What does this change address?
Closes #1220

How does this change work?
We had added @vitejs/plugin-react in the optimizeDeps > include block of the storybook vite config when we updated to Storybook v8.

Vite OptimzeDeps is a dev only setting which lists dependencies to pre-bundle.

It looks like @vitejs/plugin-react 5.x introduced a dynamic import call in its source to vite/internal. When @vitejs/plugin-react is listed in optimizeDeps.include, Vite's pre-bundler attempts to statically analyze and bundle the plugin itself, hitting this unresolvable specifier and crashing.

Removing @vitejs/plugin-react form the optimizeDeps config resolves this. If I remember correctly, the only reason it was added was that Storybook wasn't rendering locally without it at the time, so I don't see any reason we shouldn't remove it.

@brentswisher brentswisher requested a review from a team as a code owner March 10, 2026 14:00
@brentswisher brentswisher requested review from jialin-he, mtorres3 and sirrah-tam and removed request for a team March 10, 2026 14:00
@changeset-bot
Copy link

changeset-bot bot commented Mar 10, 2026

⚠️ No Changeset found

Latest commit: d4720f9

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

@brentswisher brentswisher changed the title Fix storybook not running locally Fix storybook configuration issue preventing it from running locally Mar 10, 2026
@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
packages/pharos/lib/index.js 1.04 MB (0%)

@brentswisher brentswisher merged commit d45d93e into develop Mar 10, 2026
11 checks passed
@brentswisher brentswisher deleted the hotfix/storybook-not-loading-locally branch March 10, 2026 14:19
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.

Storybook not running locally

2 participants