# Is @storybook/theming ESM-only? Can you require() it?

> @storybook/theming@8.6.14 declares CommonJS and ESM builds, but require() fails at runtime. Dual package on paper — require() failed in our runtime test.

Core Storybook Components

Last verified Sep 9, 2026 against @storybook/theming@8.6.14.

@storybook/theming declares both a CommonJS entry and a native ESM entry (ESM added in 7.0.0), but require("@storybook/theming") failed on every Node.js version in our probe: Cannot find module 'react'. That usually means a missing peer dependency, a browser-only global, or a package that refuses to be loaded with require(); see the runtime table below.

## What to do

1. require("@storybook/theming") failed in our probe on every Node.js version (Cannot find module 'react'); check the package README for peer dependencies or setup before relying on it.
2. TypeScript: types are bundled; install nothing extra.

## Facts

- Latest: 8.6.14 (May 16, 2025)
- Module format: Dual (CommonJS + ESM)
- Last CommonJS version: 8.6.14
- Native ESM since: 7.0.0
- TypeScript types: bundled
- Node engines: not declared
- Weekly downloads: 7.2M
- License: MIT

## Runtime test results for @storybook/theming@8.6.14

Installed and executed on Sep 9, 2026 with require("@storybook/theming") from a CommonJS file and import "@storybook/theming" from an ES module.

| Runtime | require("@storybook/theming") | import "@storybook/theming" |
|---|---|---|
| Node.js 18 | fails (MODULE_NOT_FOUND) | fails (ERR_MODULE_NOT_FOUND) |
| Node.js 20 | fails (MODULE_NOT_FOUND) | fails (ERR_MODULE_NOT_FOUND) |
| Node.js 22 | fails (MODULE_NOT_FOUND) | fails (ERR_MODULE_NOT_FOUND) |
| Node.js 24 | fails (MODULE_NOT_FOUND) | fails (ERR_MODULE_NOT_FOUND) |
| Node.js 26 | fails (MODULE_NOT_FOUND) | fails (ERR_MODULE_NOT_FOUND) |
| Bun 1.4.0 | fails (Error) | fails (Error) |

## How to import @storybook/theming

ES modules:

```js
import * as theming from "@storybook/theming";
```

Namespace import shown because the ESM entry may have no default export; use named imports for what it exports.

CommonJS:

```js
// require("@storybook/theming") failed in our probe on every Node.js version we test (Cannot find module 'react'); see the runtime table.
const theming = require("@storybook/theming");
```

## Module format by version

Derived from the type, main and exports fields of every stable release on npm (314 versions; the newest 60 shown).

| Versions | Format | First published |
|---|---|---|
| 8.1.7 – 8.6.18 | Dual (CommonJS + ESM) | Jun 12, 2024 |

## Frequently asked

**Is @storybook/theming ESM-only?**

@storybook/theming@8.6.14 declares CommonJS and ESM builds, but require() fails at runtime. @storybook/theming declares both a CommonJS entry and a native ESM entry (ESM added in 7.0.0), but require("@storybook/theming") failed on every Node.js version in our probe: Cannot find module 'react'. That usually means a missing peer dependency, a browser-only global, or a package that refuses to be loaded with require(); see the runtime table below.

**Can I require @storybook/theming?**

Not in practice. @storybook/theming declares a CommonJS entry, but require("@storybook/theming") failed on every Node.js version in our probe: Cannot find module 'react'. Check the package README for peer dependencies or setup before relying on it.

**Does @storybook/theming work in Bun?**

Importing @storybook/theming failed in Bun 1.4.0 on Sep 9, 2026: error: Cannot find package 'react' from '/Users/boat/Projects/top-seo/data/probe-work/@storybook__theming/node_modules/@storybook/core/dist/theming/index.js'

**Does @storybook/theming ship TypeScript types?**

Yes. @storybook/theming bundles its own type declarations; no @types package is needed.

## Links

- [@storybook/theming on npm](https://www.npmjs.com/package/@storybook/theming)
- [Source repository](https://github.com/storybookjs/storybook)
- [HTML version](https://canirequire.com/package/@storybook/theming/)
- [JSON version](https://canirequire.com/package/@storybook/theming.json)

---

For scripts and AI agents: any package is at https://canirequire.com/package/<name>/index.md (Markdown) or https://canirequire.com/package/<name>.json (JSON); the site index is https://canirequire.com/llms.txt. Fetch the URL directly; no search needed.
