docs/releases/migration-guide.mdx
Storybook 10 is a breaking maintenance release focused on ESM-only package distribution. Its main features include:
Coming soon:
This guide is meant to help you upgrade from Storybook 9.x to 10 successfully!
<Callout variant="info"> **Migrating from a Storybook version prior to 9?**You'll first need to upgrade to Storybook 9. Then you can return to this guide. </Callout>
The rest of this guide will help you upgrade successfully, either automatically or manually. But first, there are some breaking changes in Storybook 10. Here are the most impactful changes you should know about before you go further:
If any of these changes apply to your project, please read through the linked migration notes before continuing.
If any of these new requirements or changes are blockers for your project, we recommend to continue using Storybook 8.x.
You may wish to read the full migration notes before migrating. Or you can run the upgrade command below and we’ll try to take care of everything for you!
To upgrade your Storybook, run the upgrade command in the root of your repository:
<CodeSnippets path="storybook-upgrade.md" />This will:
To add Storybook to a project that isn’t currently using Storybook:
<CodeSnippets path="create-command.md" copyEvent="CreateCommandCopy" />This will:
The automatic upgrade should get your Storybook into a working state. If you encounter an error running Storybook after upgrading, here’s what to do:
doctor command to check for common issues (such as duplicate dependencies, incompatible addons, or mismatched versions) and see suggestions for fixing them.storybook with the dev command, try using the build command instead. Sometimes build errors are more legible than dev errors!If you prefer to debug yourself, here are a few useful things you can do to help narrow down the problem:
@storybook npm namespace (make sure you don't remove the storybook package). Community addons that work well with 9.x might not yet be compatible with 10.x, and this is the fastest way to isolate that possibility. If you find an addon that needs to be upgraded to work with Storybook 10, please post an issue on the addon’s repository, or better yet, a pull request to upgrade it!10.0.0-beta.56, you could set the version to 10.0.0-alpha.0 in your package.json and reinstall to verify that it still works (alpha.0 should be nearly identical to 9.1.x). If it works, you could then try 10.0.0-beta.0, then 10.0.0-beta.28 and so forth. Once you’ve isolated the bad release, read through its CHANGELOG entry and perhaps there’s a change that jumps out as the culprit. If you find the problem, please submit an issue or pull request to the Storybook monorepo and we’ll do our best to take care of it quickly.In addition to the automigrations and manual migrations above, there are also optional migrations that you should consider. These are features that we’ve deprecated in Storybook 10 (but remain backwards compatible), or best practices that should help you be more productive in the future.
test-runner to addon-vitestaddon-vitest and the rest of the Storybook Test experience is designed to supercede the test-runner. It's faster and provides a better experience for writing and running tests. If your project uses React, Vue, or Svelte and is built with Vite, you should consider migrating to addon-vitest, by following the installation instructions.