# Is @ant-design/icons ESM-only? Can you require() it?

> @ant-design/icons@6.3.4 is ESM-only. ESM-only since 6.3.0 — last CommonJS version is 6.2.5.

[![NPM version](https://img.shields.io/npm/v/@ant-design/icons.svg?style=flat)](https://npmjs.org/package/@ant-design/icons) [![NPM downloads](http://img.shields.io/npm/dm/@ant-design/icons.svg?style=flat)](https://npmjs.org/package/@ant-design/icons)

Last verified Sep 9, 2026 against @ant-design/icons@6.3.4.

@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

1. 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.
2. 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).
3. 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.
4. TypeScript: types are bundled; install nothing extra.

## Facts

- Latest: 6.3.4 (Aug 31, 2026)
- Module format: ESM-only
- Last CommonJS version: 6.2.5
- ESM-only since: 6.3.0 (Jun 26, 2026)
- TypeScript types: bundled
- Node engines: >=8
- Weekly downloads: 3.3M
- License: MIT

## Runtime test results for @ant-design/icons@6.3.4

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 | fails (SyntaxError) | fails (SyntaxError) |
| 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:

```js
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:

```js
// 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.5
```

## 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.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

- [@ant-design/icons on npm](https://www.npmjs.com/package/@ant-design/icons)
- [Source repository](https://github.com/ant-design/ant-design-icons.git#master)
- [HTML version](https://canirequire.com/package/@ant-design/icons/)
- [JSON version](https://canirequire.com/package/@ant-design/icons.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.
