or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

index.md
tile.json

tessl/npm-storybook--addon-backgrounds

Deprecated Storybook addon that throws migration errors directing users to the new package structure in Storybook 9.0

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/@storybook/addon-backgrounds@9.0.x

To install, run

npx @tessl/cli install tessl/npm-storybook--addon-backgrounds@9.0.0

index.mddocs/

@storybook/addon-backgrounds

@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.

Package Information

  • Package Name: @storybook/addon-backgrounds
  • Package Type: npm
  • Language: TypeScript
  • Installation: npm install @storybook/addon-backgrounds (not recommended)
  • Status: Deprecated in Storybook 9.0
  • Migration Guide: https://storybook.js.org/docs/9/migration-guide#package-structure-changes

Core Imports

All import patterns result in the same error being thrown:

import * as backgrounds from '@storybook/addon-backgrounds';              // Throws error
import * as preview from '@storybook/addon-backgrounds/preview';          // Throws error
import * as manager from '@storybook/addon-backgrounds/manager';          // Throws error

CommonJS:

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 error

Basic Usage

This 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"

Architecture

The package implements a simple error-throwing mechanism designed to provide clear migration guidance:

  • Error Module (src/error.ts): Contains a single throw statement that executes immediately when imported
  • Entry Point Strategy: All entry points (index.ts, preview.tsx, manager.tsx) simply import the error module
  • Immediate Execution: The error is thrown at module import time, preventing any further code execution
  • Consistent Behavior: All entry points exhibit identical error behavior to ensure consistent user experience

This design ensures that any attempt to use the deprecated package results in clear, actionable error messages directing users to the migration guide.

Capabilities

Error Throwing

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"

Entry Points

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)

Migration Information

Background Functionality Location

The backgrounds functionality previously provided by this addon has been moved to:

  • Storybook's core blocks system as part of the package structure changes in version 9.0
  • Users should remove this dependency and configure backgrounds through the new core system
  • See the official Storybook 9 migration guide for detailed instructions

Recommended Actions

  1. Remove @storybook/addon-backgrounds from dependencies
  2. Update Storybook configuration to use the new core blocks system
  3. Follow the migration guide at: https://storybook.js.org/docs/9/migration-guide#package-structure-changes

Error Handling

This 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");

Package Structure

The package contains the following entry points, all of which import the error throwing mechanism:

  • src/index.ts - Main entry point
  • src/preview.tsx - Preview entry point
  • src/manager.tsx - Manager entry point
  • src/error.ts - Core error throwing functionality

All source files contain only import './error'; statements.