canirequire › Dual (CommonJS + ESM) › @storybook/theming
Is @storybook/theming ESM-only? Can you require() it?
Core Storybook Components
Last verified Sep 9, 2026 against @storybook/theming@8.6.14. JSON
Dual (CommonJS + ESM) Dual package — both require() and import work
@storybook/theming publishes both a CommonJS entry and a native ESM entry (ESM added in 7.0.0). require("@storybook/theming") and import "@storybook/theming" both work on every supported Node.js version and in Bun.
Does @storybook/theming@8.6.14 actually load? Runtime test results
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 | ✗ failsMODULE_NOT_FOUND | ✗ failsERR_MODULE_NOT_FOUND |
| Node.js 20 | ✗ failsMODULE_NOT_FOUND | ✗ failsERR_MODULE_NOT_FOUND |
| Node.js 22 | ✗ failsMODULE_NOT_FOUND | ✗ failsERR_MODULE_NOT_FOUND |
| Node.js 24 | ✗ failsMODULE_NOT_FOUND | ✗ failsERR_MODULE_NOT_FOUND |
| Node.js 26 | ✗ failsMODULE_NOT_FOUND | ✗ failsERR_MODULE_NOT_FOUND |
| Bun 1.4 | ✗ failserror: Cannot find package 'react' from '/Users/boat/Projects/top-seo/data/probe-work/@storybook__theming/node_modules/@storybook/core/dist/theming/index.cjs' | ✗ failserror: Cannot find package 'react' from '/Users/boat/Projects/top-seo/data/probe-work/@storybook__theming/node_modules/@storybook/core/dist/theming/index.js' |
A failing require() on a CommonJS package usually means the package needs a browser/DOM global, a peer dependency, or a native binary that is not available in a bare Node.js process.
How to import @storybook/theming
ES modules (import)
import theming from "@storybook/theming";CommonJS (require)
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 ships CommonJS and ESM builds. @storybook/theming publishes both a CommonJS entry and a native ESM entry (ESM added in 7.0.0). require("@storybook/theming") and import "@storybook/theming" both work on every supported Node.js version and in Bun.
Can I require @storybook/theming?
Yes. @storybook/theming ships a CommonJS entry, so require("@storybook/theming") works on every Node.js version, alongside the native ESM entry for import.
Does @storybook/theming work in Bun?
Importing @storybook/theming failed in Bun 1.4 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
Other dual (commonjs + esm) packages
- minimatch 10.2.6Dual
- brace-expansion 5.0.9Dual
- lru-cache 11.5.2Dual
- glob 13.0.6Dual
- eslint-visitor-keys 5.0.1Dual
- yallist 5.0.0Dual
- balanced-match 4.0.4Dual
- js-yaml 5.4.1Dual
Similar popularity
- @babel/runtime-corejs3 8.0.0Dual
- @babel/plugin-proposal-numeric-separator 7.18.6CommonJS
- @babel/register 8.0.1ESM-only
- @rollup/plugin-babel 7.1.0Dual
- @mui/material 9.4.0Dual
- @rollup/plugin-json 6.1.0Dual
- @babel/plugin-proposal-export-default-from 8.0.1ESM-only
- @vueuse/core 14.4.0ESM-only