Skip to content

Conversation

@ndelangen
Copy link
Member

@ndelangen ndelangen commented Oct 29, 2025

What I did

On a pnpm project created using:

pnpm dlx storybook@latest init
chose React + Vite (TS)
chose Recommended: Component dev, docs, test
everything installed correctly and sb starts
click “run test”

After init, press the "run tests" button and you'll see the following in the command-line:

storybook/test: 2:21:20 p.m. [vite] (client) Re-optimizing dependencies because vite config has changed
storybook/test: info Using tsconfig paths for react-docgen
storybook/test: Failed to resolve dependency: @mdx-js/react, present in client 'optimizeDeps.include'
storybook/test: Failed to resolve dependency: markdown-to-jsx, present in client 'optimizeDeps.include'

I've adjusted the optimizeDeps setting in addon-docs so this should not longer happen.

I noticed together with @yannbf that the manually added optimizeDeps were getting filtered out. This seemed wrong to us, because whatever is adding those includes, should make sure they are actually needed/valid.

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

Try a project WITH addon-vitest, but WITHOUT addon-docs, and check if the test complete correctly

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>

@ndelangen ndelangen added bug patch:yes Bugfix & documentation PR that need to be picked to main branch addon: docs ci:normal addon: vitest labels Oct 29, 2025
@nx-cloud
Copy link

nx-cloud bot commented Oct 29, 2025

View your CI Pipeline Execution ↗ for commit 02609c1

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 43s View ↗

☁️ Nx Cloud last updated this comment at 2025-10-29 15:12:03 UTC

@ndelangen ndelangen merged commit b3d0932 into next Oct 29, 2025
58 checks passed
@ndelangen ndelangen deleted the norbert/improve-optimizedeps-array branch October 29, 2025 15:12
ndelangen added a commit that referenced this pull request Oct 30, 2025
…ps-array

Vite: Update `optimizeViteDeps` for addon-docs and addon-vitest
(cherry picked from commit b3d0932)
ndelangen added a commit that referenced this pull request Oct 30, 2025
…ps-array

Vite: Update `optimizeViteDeps` for addon-docs and addon-vitest
(cherry picked from commit b3d0932)
@github-actions github-actions bot added patch:done Patch/release PRs already cherry-picked to main/release branch labels Oct 30, 2025
@ndelangen ndelangen added the needs qa Indicates that this needs manual QA during the upcoming minor/major release label Nov 21, 2025
@yannbf yannbf removed the needs qa Indicates that this needs manual QA during the upcoming minor/major release label Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

addon: docs addon: vitest bug ci:normal patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants