Skip to content

Conversation

@ndelangen
Copy link
Member

@ndelangen ndelangen commented Oct 24, 2025

What I did

Bump vite-plugin-storybook-nextjs to v3

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

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

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>

Summary by CodeRabbit

  • Chores
    • Updated vite-plugin-storybook-nextjs to version 3.0.0 for the Next.js Vite framework configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 24, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • code/yarn.lock is excluded by !**/yarn.lock, !**/*.lock

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

Updated the vite-plugin-storybook-nextjs dependency from a canary version to a stable major version (3.0.0) in the Next.js Vite framework package configuration.

Changes

Cohort / File(s) Summary
Dependency upgrade
code/frameworks/nextjs-vite/package.json
Upgraded vite-plugin-storybook-nextjs from 2.1.0--canary.62.12de69e.0 to ^3.0.0

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch norbert/bump-vite-plugin-storybook-nextjs

Comment @coderabbitai help to get the list of available commands and usage tips.

@ndelangen ndelangen added dependencies nextjs ci:merged Run the CI jobs that normally run when merged. labels Oct 24, 2025
@ndelangen ndelangen self-assigned this Oct 24, 2025
@ndelangen ndelangen requested a review from yannbf October 24, 2025 09:03
@ndelangen ndelangen marked this pull request as ready for review October 24, 2025 09:03
@ndelangen ndelangen added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Oct 24, 2025
@nx-cloud
Copy link

nx-cloud bot commented Oct 24, 2025

View your CI Pipeline Execution ↗ for commit 93c3215

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

☁️ Nx Cloud last updated this comment at 2025-10-24 11:14:21 UTC

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a0ceb4e and d4916d1.

⛔ Files ignored due to path filters (1)
  • code/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (1)
  • code/frameworks/nextjs-vite/package.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,json,html,ts,tsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{js,jsx,json,html,ts,tsx,mjs}: Run Prettier formatting on changed files before committing
Run ESLint on changed files and fix all errors/warnings before committing (use yarn lint:js:cmd <file>)

Files:

  • code/frameworks/nextjs-vite/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: merged
  • GitHub Check: Danger JS
  • GitHub Check: Core Unit Tests, windows-latest
🔇 Additional comments (1)
code/frameworks/nextjs-vite/package.json (1)

81-87: No code changes needed—v3.0.0 explicitly supports Next.js 15 via peer dependencies.

The yarn.lock shows v3.0.0 has peer dependency "next": "^14.1.0 || ^15.0.0 || ^16.0.0", which directly contradicts the review's concern about compatibility. The framework's devDependency next: ^15.2.3 falls safely within this supported range.

The documented breaking change "Support next 16" is additive, not destructive—it adds support for a new Next.js version rather than dropping support for Next.js 15. The framework code already contains version detection logic for Next.js 16+ vs pre-16 branching, so no code updates are required.

The dependency is used via simple require/re-export in two locations (preset.ts and vite-plugin/index.ts), with no API calls that would break between versions. The ^3.0.0 version range is appropriate and allows minor/patch updates consistent with the peer dependency constraints.

Likely an incorrect or invalid review comment.

"@storybook/react-vite": "workspace:*",
"styled-jsx": "5.1.6",
"vite-plugin-storybook-nextjs": "2.1.0--canary.62.12de69e.0"
"vite-plugin-storybook-nextjs": "^3.0.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify breaking changes and Next.js 15 compatibility for vite-plugin-storybook-nextjs v3.

This is a major version bump (2.1.0-canary → 3.0.0) with unknown breaking changes. The project uses Next.js 15.2.3, which itself has breaking changes (async Request APIs). The PR checklist shows all test types unchecked and no manual testing steps provided, which is risky for a major dependency upgrade.

Please verify and document:

  1. Breaking changes in v3: What breaking changes exist in vite-plugin-storybook-nextjs v3.0.0?
  2. Next.js 15 compatibility: Is v3 tested and compatible with Next.js 15.2.3?
  3. Code migration needs: Does the framework code in code/frameworks/nextjs-vite/ require updates to work with v3?
  4. Test coverage: Why are all automated tests unchecked? What testing was performed locally?

I'll search for the v3 release notes to understand the scope of changes:The search results provide some context but don't clearly show v3.0.0 breaking changes. Let me search more specifically:Based on the search results, I found that the vite-plugin-storybook-nextjs was updated to 2.0.7 in an earlier release, and the current PR updates it to 3.0.0, which is a major version bump. The search results show various NextJS-Vite issues but don't provide explicit breaking changes documentation. Let me check if there are any code changes required in the framework package itself:Let me now complete the review based on what I've gathered:


I'll gather the necessary information to verify the review comment about this vite-plugin-storybook-nextjs upgrade.





---

🏁 Script executed:

```shell
#!/bin/bash
# Check if there are any imports or usages of vite-plugin-storybook-nextjs in the framework code
# to determine if code changes are needed for v3 upgrade
find code/frameworks/nextjs-vite -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \) -exec grep -l "vite-plugin-storybook-nextjs" {} \;

Length of output: 135


🌐 Web query:

vite-plugin-storybook-nextjs v3.0.0 release notes breaking changes

💡 Result:

v3.0.0 (released 2025‑10‑24) — breaking change: requires/supports Next.js 16 (See release note). [1]

Sources
[1] GitHub — vite-plugin-storybook-nextjs release v3.0.0.


🌐 Web query:

vite-plugin-storybook-nextjs Next.js 15 compatibility

💡 Result:

Short answer: partially — the plugin declares support for Next.js >= 14.1.0, but Next.js 15 introduced breaking changes that currently cause problems in the Storybook + Vite toolchain (module resolution, compiled React paths, test/Vitest issues, plus other Next‑15 behaviour). Expect some features to work but others (Vitest addon, certain Next 15 internals like compiled React subpaths, some server‑component/runtime features) to fail or need workarounds. [1][2][3]

Details / references:

  • vite-plugin-storybook-nextjs README (requires Next.js v14.1.0 or higher). [1]
  • Storybook maintainers tracking Next.js 15 investigation and known incompatibilities. [2]
  • Reported bug where Storybook/Vitest fails in Next.js 15 because Next compiles React into internal paths (causes module resolution errors). Workarounds (for now) include using Storybook UI testing instead of the Vitest addon. [3]

If you want, I can:

  • check the exact versions in your project and suggest a concrete configuration/workaround, or
  • search for any newly released fixes/PRs that target Next.js 15 compatibility.

I found a critical issue. Let me verify the Next.js version in the project:


---

🏁 Script executed:

```shell
#!/bin/bash
# Check the Next.js version in code/frameworks/nextjs-vite/package.json
grep -A 1 '"next"' code/frameworks/nextjs-vite/package.json | head -5

Length of output: 89


DO NOT MERGE: vite-plugin-storybook-nextjs v3.0.0 requires Next.js 16, but project uses 15.2.3.

vite-plugin-storybook-nextjs v3.0.0 requires/supports Next.js 16, making it incompatible with the current Next.js 15.2.3. The plugin is actively imported across 3 framework files (src/index.ts, src/preset.ts, src/vite-plugin/index.ts), so this incompatibility will break the build and tests.

Required fix:

  • Upgrade to Next.js 16 in the same PR, OR
  • Revert to vite-plugin-storybook-nextjs v2.x compatible with Next.js 15
🤖 Prompt for AI Agents
In code/frameworks/nextjs-vite/package.json around line 86, the dependency
"vite-plugin-storybook-nextjs": "^3.0.0" requires Next.js 16 while the project
uses Next.js 15.2.3; this will break imports in src/index.ts, src/preset.ts, and
src/vite-plugin/index.ts. Fix by either (A) upgrading Next.js to v16 in this PR:
bump the next dependency in package.json to a v16 release, run install, update
any Next 16 migration changes required by the three affected files, and run
tests; or (B) revert the plugin to a v2.x release compatible with Next.js 15:
change the dependency to a 2.x version, run install, and verify the existing
imports compile and tests pass.

@yannbf yannbf merged commit 4a4b43c into next Oct 24, 2025
70 checks passed
@yannbf yannbf deleted the norbert/bump-vite-plugin-storybook-nextjs branch October 24, 2025 11:23
yannbf added a commit that referenced this pull request Oct 24, 2025
…torybook-nextjs

Dependencies: Update `vite-plugin-storybook-nextjs`
(cherry picked from commit 4a4b43c)
@github-actions github-actions bot mentioned this pull request Oct 24, 2025
5 tasks
@github-actions github-actions bot added the patch:done Patch/release PRs already cherry-picked to main/release branch label Oct 24, 2025
@ndelangen ndelangen removed the patch:yes Bugfix & documentation PR that need to be picked to main branch label Oct 28, 2025
@coderabbitai coderabbitai bot mentioned this pull request Oct 28, 2025
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:merged Run the CI jobs that normally run when merged. dependencies nextjs patch:done Patch/release PRs already cherry-picked to main/release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants