Deprecated Storybook addon that throws migration errors directing users to the new package structure in Storybook 9.0
npx @tessl/cli install tessl/npm-storybook--addon-backgrounds@9.0.0@storybook/addon-backgrounds is a deprecated Storybook addon package as of version 9.0. This package serves as a compatibility layer that throws informative error messages directing users to migrate to Storybook's new package structure. The actual backgrounds functionality has been moved to Storybook's core blocks system.
npm install @storybook/addon-backgrounds (not recommended)All import patterns result in the same error being thrown:
import * as backgrounds from '@storybook/addon-backgrounds'; // Throws errorimport * as preview from '@storybook/addon-backgrounds/preview'; // Throws errorimport * as manager from '@storybook/addon-backgrounds/manager'; // Throws errorCommonJS:
const backgrounds = require('@storybook/addon-backgrounds'); // Throws error
const preview = require('@storybook/addon-backgrounds/preview'); // Throws error
const manager = require('@storybook/addon-backgrounds/manager'); // Throws errorThis package cannot be used functionally. Any attempt to import or require this package will result in an error:
import '@storybook/addon-backgrounds';
// Throws: "Your Storybook project is referring to package @storybook/addon-backgrounds,
// which no longer exists in Storybook 9.0 and above. Please refer to the Storybook 9
// migration guide for instructions on how to fix this issue:
// https://storybook.js.org/docs/9/migration-guide#package-structure-changes"The package implements a simple error-throwing mechanism designed to provide clear migration guidance:
src/error.ts): Contains a single throw statement that executes immediately when importedindex.ts, preview.tsx, manager.tsx) simply import the error moduleThis design ensures that any attempt to use the deprecated package results in clear, actionable error messages directing users to the migration guide.
The sole capability of this package is to throw migration errors when imported.
/**
* Error thrown when attempting to import any entry point of this package
* Contains migration guidance for users upgrading to Storybook 9.0+
*/
Error: "Your Storybook project is referring to package @storybook/addon-backgrounds, which no longer exists in Storybook 9.0 and above. Please refer to the Storybook 9 migration guide for instructions on how to fix this issue: https://storybook.js.org/docs/9/migration-guide#package-structure-changes"All entry points exhibit identical behavior:
// Main entry point
import '@storybook/addon-backgrounds'; // Throws Error
// Preview entry point
import '@storybook/addon-backgrounds/preview'; // Throws Error
// Manager entry points
import '@storybook/addon-backgrounds/manager'; // Throws Error
import '@storybook/addon-backgrounds/register'; // Throws Error (alias)The backgrounds functionality previously provided by this addon has been moved to:
@storybook/addon-backgrounds from dependenciesThis package intentionally throws errors for all operations. There is no way to suppress or handle these errors - they are designed to be fatal to ensure users are aware of the deprecation and migration requirements.
/**
* Internal error throwing mechanism - executes immediately when imported
* Located in src/error.ts - not a function but a top-level throw statement
*/
throw new Error("Your Storybook project is referring to package @storybook/addon-backgrounds, which no longer exists in Storybook 9.0 and above. Please refer to the Storybook 9 migration guide for instructions on how to fix this issue: https://storybook.js.org/docs/9/migration-guide#package-structure-changes");The package contains the following entry points, all of which import the error throwing mechanism:
src/index.ts - Main entry pointsrc/preview.tsx - Preview entry pointsrc/manager.tsx - Manager entry pointsrc/error.ts - Core error throwing functionalityAll source files contain only import './error'; statements.