canirequire › ESM-only › @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. Markdown · JSON
ESM-only ESM-only since 6.3.0 — last CommonJS version is 6.2.5
@ant-design/icons dropped its CommonJS build in 6.3.0 (June 2026). The last version with a plain require()-able CommonJS entry is 6.2.5, published May 28, 2026; it declares support for Node.js >=8.
On Node.js 20.19+, 22.12+ and newer, require("@ant-design/icons") works with the latest version: Node.js loads synchronous ES modules through require(). Verified on Node.js 20, 22, 24 and 26. On Node.js 18, which has no require(esm), require("@ant-design/icons") fails with ERR_REQUIRE_ESM.
What to do
- On Node.js 20.19+, 22.12+ and newer, require("@ant-design/icons") works with the latest version: Node.js loads synchronous ES modules through require(). Verified on Node.js 20, 22, 24 and 26.
- From a CommonJS file, use a dynamic import inside an async function: const icons = await import("@ant-design/icons"). That works on every Node.js version the package supports (>=8).
- If you need a synchronous require() or run Node.js 18: npm install @ant-design/icons@6.2.5, the last CommonJS release (published May 28, 2026); it declares Node.js >=8.
- TypeScript: types are bundled; install nothing extra.
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.0 | ✓ works | ✓ works |
How to import @ant-design/icons
ES modules (import)
import * as icons from "@ant-design/icons";Namespace import shown because the ESM entry may have no default export; use named imports for what it exports.
CommonJS (require)
// Node.js 20.19+, 22.12+ and newer (verified):
const icons = require("@ant-design/icons");
// Any Node.js version the package supports (>=8), from an async function:
async function main() {
const icons = await import("@ant-design/icons");
}
// Or pin the last CommonJS release (declares Node.js >=8):
// npm install @ant-design/icons@6.2.5Module 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 (95 versions; the newest 60 shown).
| Versions | Format | First published |
|---|---|---|
| 6.3.0 – 6.3.4 | ESM-only | Jun 26, 2026 |
| 6.2.0 – 6.2.5 | 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 is ESM-only. @ant-design/icons dropped its CommonJS build in 6.3.0 (June 2026). The last version with a plain require()-able CommonJS entry is 6.2.5, published May 28, 2026; it declares support for Node.js >=8.
Which version of @ant-design/icons still supports CommonJS / require()?
6.2.5 is the last version of @ant-design/icons with a CommonJS build; it declares Node.js >=8. Install it with "npm install @ant-design/icons@6.2.5". Every version from 6.3.0 on is ESM-only.
How do I use @ant-design/icons from a CommonJS file?
From a CommonJS file, use a dynamic import inside an async function: const icons = await import("@ant-design/icons"). That works on every Node.js version the package supports (>=8). On Node.js 20.19+, 22.12+ and newer, require("@ant-design/icons") works with the latest version: Node.js loads synchronous ES modules through require(). Verified on Node.js 20, 22, 24 and 26. Alternatively pin @ant-design/icons@6.2.5 (declares Node.js >=8).
Does @ant-design/icons work in Bun?
Yes. import "@ant-design/icons" loaded successfully in Bun 1.4.0 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 esm-only packages
- ansi-styles 7.0.0last CJS
5.2.0 - strip-ansi 7.2.0last CJS
6.0.1 - commander 15.0.0last CJS
14.0.3 - supports-color 11.0.0last CJS
8.1.1 - chalk 6.0.0last CJS
4.1.2 - string-width 8.2.2last CJS
4.2.3 - ansi-regex 6.3.0last CJS
5.0.1 - escape-string-regexp 5.0.0last CJS
4.0.0
Similar popularity
- should 13.2.3CommonJS
- eslint-webpack-plugin 6.0.0CommonJS
- mobx 7.0.3Dual
- eslint-config-react-app 7.0.1CommonJS
- workbox-webpack-plugin 7.4.1CommonJS
- babel-preset-react-app 10.1.0CommonJS
- antd 6.6.3CommonJS
- babel-plugin-syntax-jsx 6.18.0CommonJS