Storybook "Failed to load preset" in CI
Storybook resolves every entry in addons and the framework as a preset. "Failed to load preset" means one of them could not be required, usually because the package is missing from a clean CI install or its version mismatches the Storybook core.
What this error means
The build fails early with "Failed to load preset: '@storybook/addon-...'" or "Failed to load preset: .../preset.js", often followed by "Cannot find module".
Error: Failed to load preset: "@storybook/addon-essentials/preset" on level 1
Cannot find module '@storybook/addon-essentials/preset'Common causes
The addon is not installed in CI
It works locally because it is present, but it was never added to package.json, so a clean npm ci in CI does not install it.
A version mismatch between core and preset
The addon major does not match the Storybook major (a 7 addon under Storybook 8), so its preset export cannot initialize.
How to fix it
Install the preset and align versions
- Add the named addon to
devDependenciessonpm ciinstalls it. - Match its major version to your Storybook core version.
- Commit the lockfile and re-run the build.
npm install -D @storybook/addon-essentials@^8Remove a preset you no longer use
If the addon was deleted, drop it from the addons array in .storybook/main.js so Storybook stops trying to load it.
// .storybook/main.js
export default {
addons: ['@storybook/addon-essentials'],
};How to prevent it
- Keep every addon in
package.jsonat a version matching Storybook core. - Run
npm ci(clean install) locally to catch missing addons before CI. - Bump addons together with Storybook using its upgrade command.