canirequire › Dual (CommonJS + ESM) › @ant-design/icons
Is @ant-design/icons ESM-only? Can you require() it?
[](https://npmjs.org/package/@ant-design/icons) [](https://npmjs.org/package/@ant-design/icons)
Last verified Sep 9, 2026 against @ant-design/icons@6.3.4. JSON
Dual (CommonJS + ESM) Dual package — both require() and import work
@ant-design/icons publishes both a CommonJS entry and a native ESM entry (ESM added in 6.2.0). require("@ant-design/icons") and import "@ant-design/icons" both work on every supported Node.js version and in Bun.
Does @ant-design/icons@6.3.4 actually load? Runtime test results
Installed and executed on Sep 9, 2026 with require("@ant-design/icons") from a CommonJS file and import "@ant-design/icons" from an ES module.
| Runtime | require("@ant-design/icons") | import "@ant-design/icons" |
|---|---|---|
| Node.js 18 | ✗ failsSyntaxError | ✗ failsSyntaxError |
| Node.js 20 | ✓ works | ✓ works |
| Node.js 22 | ✓ works | ✓ works |
| Node.js 24 | ✓ works | ✓ works |
| Node.js 26 | ✓ works | ✓ works |
| Bun 1.4 | ✓ 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 @ant-design/icons
ES modules (import)
import icons from "@ant-design/icons";CommonJS (require)
const icons = require("@ant-design/icons");Module format by version
Derived from the type, main and exports fields of every stable release on npm (95 versions; the newest 60 shown).
| Versions | Format | First published |
|---|---|---|
| 6.2.0 – 6.3.4 | Dual (CommonJS + ESM) | Apr 27, 2026 |
| 4.2.0 – 6.1.1 | CommonJS | May 29, 2020 |
Frequently asked
Is @ant-design/icons ESM-only?
@ant-design/icons@6.3.4 ships CommonJS and ESM builds. @ant-design/icons publishes both a CommonJS entry and a native ESM entry (ESM added in 6.2.0). require("@ant-design/icons") and import "@ant-design/icons" both work on every supported Node.js version and in Bun.
Can I require @ant-design/icons?
Yes. @ant-design/icons ships a CommonJS entry, so require("@ant-design/icons") works on every Node.js version, alongside the native ESM entry for import.
Does @ant-design/icons work in Bun?
Yes. import "@ant-design/icons" loaded successfully in Bun 1.4 on Sep 9, 2026.
Does @ant-design/icons ship TypeScript types?
Yes. @ant-design/icons 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/cli 8.0.4CommonJS
- @angular/compiler-cli 22.1.5ESM-only
- @angular/forms 22.1.5ESM-only
- @angular/router 22.1.5ESM-only
- @angular/platform-browser-dynamic 22.1.5ESM-only
- @angular-devkit/build-angular 22.1.7CommonJS
- @oclif/plugin-help 7.0.0ESM-only
- @changesets/cli 3.0.2ESM-only