Skip to content
Latchkey

Storybook "Failed to load preset" in CI

Storybook resolves every entry in addons and framework as a preset. "Failed to load preset" means one of those preset packages could not be imported, usually because it is uninstalled or errors at load time.

What this error means

The build aborts early with "Error: Failed to load preset: \"@storybook/addon-essentials/preset\"" and a nested cause naming the package or a thrown error.

storybook
Error: Failed to load preset: "@storybook/addon-essentials/preset" on level 1
    at loadPreset (.../node_modules/@storybook/core-common/dist/index.js)
  Cannot find module '@storybook/addon-essentials'

Common causes

The addon preset package is not installed

An addon referenced in .storybook/main is in config but not in package.json, so CI never installs it and the preset fails to load.

The preset throws during initialization

A preset can fail if it imports a peer that is absent or if it is incompatible with the installed Storybook core version.

How to fix it

Install the addon named in the message

  1. Read the preset path in the error to identify the addon.
  2. Add the addon package to devDependencies.
  3. Reinstall and re-run the Storybook build.
Terminal
npm install --save-dev @storybook/addon-essentials

Match addon versions to core

A preset built for a different Storybook major can fail to load. Upgrade addons together with core.

Terminal
npx storybook@latest upgrade

How to prevent it

  • List every addon in .storybook/main as an installed devDependency.
  • Keep addons and core on the same Storybook version.
  • Run the Storybook build in CI on a clean install to catch missing presets.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →