Migration
Nuxt Storybook v10 adds support for Storybook 10 and Nuxt 4. This page lists everything that changed in a breaking way and what to do about it.
Requirements
| v9 | v10 | |
|---|---|---|
| Node.js | 20+ | 22+ |
| Storybook | 9.0.x | 10.6+ |
| Nuxt | 3.13+ | 3.18.1+ or 4.x |
| Vite | 5, 6 or 7 | 5, 6, 7 or 8 |
| vue-router | 4.x | 5.x |
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 the Storybook upgrade command 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@latest upgrade
yarn dlx storybook@latest upgrade
npx storybook@latest upgrade
Refer to the Storybook 10 migration guide for changes that are specific to Storybook itself.
3. Upgrade the Nuxt module
pnpm add -D @nuxtjs/storybook@^10
yarn add -D @nuxtjs/storybook@^10
npm install -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:
import type { StorybookConfig } from '@nuxtjs/storybook'
const config: StorybookConfig = {
framework: '@storybook-vue/nuxt',
stories: ['../components/**/*.stories.ts'],
viteFinal(config) {
config.optimizeDeps ??= {}
config.optimizeDeps.include ??= []
config.optimizeDeps.include.push('my-cjs-dependency')
return config
},
}
export default config
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/storybookships its types fromdist/module.d.mts. Thedist/types.d.mtsfile no longer exists.getNuxtProxyConfig()from@storybook-vue/nuxt/presetreturns{ proxy, route, target }. Theportproperty 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:
{
"devDependencies": {
"@nuxtjs/storybook": "https://pkg.pr.new/@nuxtjs/storybook@main"
}
}