Migration

Upgrade to v10

Upgrade Nuxt Storybook from v9 to v10 and Storybook 10.

Nuxt Storybook v10 adds support for Storybook 10 and Nuxt 4.

Requirements

v9v10
Node.js20+22+
Storybook9.0.x10.6+
Nuxt3.13+3.18.1+ or 4.x
Vite5, 6 or 75, 6, 7 or 8
vue-router4.x5.x
Storybook 10 is an ESM-only package. Nuxt Storybook v10 does not support Storybook 8 or 9 anymore. Stay on v9 of the module if you cannot upgrade Storybook yet.

Upgrade steps

1. Update Node.js

Make sure you run Node.js 22 or later. Both @nuxtjs/storybook and @storybook-vue/nuxt declare "node": ">=22.0.0" in their engines field, so older versions will produce install warnings or errors depending on your package manager.

2. Upgrade Storybook

Run storybook@^10 upgrade in your project root. It bumps every storybook and @storybook/* package to the latest 10.x release and runs the automigrations for Storybook 10.

pnpm dlx storybook@^10 upgrade

Read the Storybook 10 migration guide for the changes that apply to every Storybook project.

3. Upgrade the Nuxt module

pnpm add -D @nuxtjs/storybook@^10

If you use the framework package directly without the Nuxt module, upgrade @storybook-vue/nuxt to ^10 instead.

4. Upgrade Nuxt

Nuxt Storybook v10 requires Nuxt 3.18.1 or later and also works with Nuxt 4. Projects on an older Nuxt 3 release will fail the module's compatibility check at startup.

The module now depends on vue-router v5. If your project pins vue-router v4 explicitly, remove the pin and let Nuxt resolve the version.

Vite config

Vite dependency discovery is disabled

The final Vite config sets optimizeDeps.noDiscovery to true. Vite no longer scans for dependencies to pre-bundle, which prevents it from missing components that are imported through virtual modules such as #components. If a dependency needs pre-bundling, add it to optimizeDeps.include in your viteFinal:

.storybook/main.ts
import { 
defineMain
} from '@storybook-vue/nuxt/node'
export default
defineMain
({
framework
: '@storybook-vue/nuxt',
stories
: ['../components/**/*.stories.ts'],
viteFinal
: (
config
) => ({
...
config
,
optimizeDeps
: {
...
config
.
optimizeDeps
,
include
: [...(
config
.
optimizeDeps
?.
include
?? []), 'my-cjs-dependency'],
}, }), })

vue resolves to an absolute path

The module aliases vue to the absolute path of vue/dist/vue.esm-bundler.js resolved from your project. This runs after Storybook's own plugins, so a custom vue alias in viteFinal will be overridden. This avoids an infinite resolve loop with Nuxt's bare import resolver.

Package exports

  • @nuxtjs/storybook ships its types from dist/module.d.mts. The dist/types.d.mts file no longer exists.
  • getNuxtProxyConfig() from @storybook-vue/nuxt/preset returns { proxy, route, target }. The port property was removed.

Preview builds

The @nuxtjs/storybook@nightly npm tag is no longer published. Use pkg.pr.new instead to test the latest main branch or a specific pull request:

package.json
{
  "devDependencies": {
    "@nuxtjs/storybook": "https://pkg.pr.new/@nuxtjs/storybook@main"
  }
}
See the Setup page for details on opting in and out of preview builds.