canirequire

canirequire › CommonJS › @storybook/addon-info

Is @storybook/addon-info ESM-only? Can you require() it?

A Storybook addon to show additional information for your stories.

Last verified Sep 9, 2026 against @storybook/addon-info@5.3.21. Markdown · JSON

CommonJS CommonJS on paper — require() failed in our runtime test

@storybook/addon-info declares a CommonJS entry only, but require("@storybook/addon-info") failed on every Node.js version in our probe: SyntaxError: Unexpected token '.'. import "@storybook/addon-info" resolves to the same file, so it fails the same way. That usually means a missing peer dependency, a browser-only global, or a package that is not meant to be loaded directly; see the runtime table below.

What to do

  1. require("@storybook/addon-info") failed in our probe on every Node.js version (SyntaxError: Unexpected token '.'); check the package README for peer dependencies or setup before relying on it.
  2. From ES modules use the default import: import addonInfo from "@storybook/addon-info"; then destructure. Named imports only work when Node.js can statically detect the exports.
  3. TypeScript: npm install -D @types/storybook__addon-info
Latest
5.3.21 (Aug 28, 2020)
Module format
CommonJS
Last CommonJS version
5.3.21
TypeScript types
@types/storybook__addon-info
Node engines
not declared
Weekly downloads
40K
License
MIT

Does @storybook/addon-info@5.3.21 actually load? Runtime test results

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

Runtimerequire("@storybook/addon-info")import "@storybook/addon-info"
Node.js 18✗ failsSyntaxError✗ failsSyntaxError
Node.js 20✗ failsSyntaxError✗ failsSyntaxError
Node.js 22✗ failsSyntaxError✗ failsSyntaxError
Node.js 24✗ failsSyntaxError✗ failsSyntaxError
Node.js 26✗ failsSyntaxError✗ failsSyntaxError
Bun 1.4.0✓ works✓ works

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/addon-info

ES modules (import)

import addonInfo from "@storybook/addon-info";

Named imports from a CommonJS package only work when Node.js can statically detect them. If a named import fails, use the default import and destructure.

CommonJS (require)

// require("@storybook/addon-info") failed in our probe on every Node.js version we test (SyntaxError: Unexpected token '.'); see the runtime table.
const addonInfo = require("@storybook/addon-info");

Module format by version

Derived from the type, main and exports fields of every stable release on npm, corrected where a runtime test of that version contradicted them (133 versions; the newest 60 shown).

VersionsFormatFirst published
4.1.9 – 5.3.21CommonJSJan 23, 2019

Frequently asked

Is @storybook/addon-info ESM-only?

@storybook/addon-info@5.3.21 declares a CommonJS entry, but require() fails at runtime. @storybook/addon-info declares a CommonJS entry only, but require("@storybook/addon-info") failed on every Node.js version in our probe: SyntaxError: Unexpected token '.'. import "@storybook/addon-info" resolves to the same file, so it fails the same way. That usually means a missing peer dependency, a browser-only global, or a package that is not meant to be loaded directly; see the runtime table below.

Can I require @storybook/addon-info?

Not in practice. @storybook/addon-info declares a CommonJS entry, but require("@storybook/addon-info") failed on every Node.js version in our probe: SyntaxError: Unexpected token '.'. Check the package README for peer dependencies or setup before relying on it.

Can I import @storybook/addon-info with ES module syntax?

Yes. import addonInfo from "@storybook/addon-info" works in Node.js and Bun because they support importing CommonJS modules. Named imports work only when Node.js can statically detect the exports.

Does @storybook/addon-info work in Bun?

Yes. import "@storybook/addon-info" loaded successfully in Bun 1.4.0 on Sep 9, 2026.

Does @storybook/addon-info ship TypeScript types?

Not bundled. Install the community types with "npm install -D @types/storybook__addon-info".

Links

Other commonjs packages

Similar popularity