canirequire

canirequireDual (CommonJS + ESM) › element-plus

Is element-plus ESM-only? Can you require() it?

A Component Library for Vue 3

Last verified Sep 9, 2026 against element-plus@2.14.5. JSON

Dual (CommonJS + ESM) Dual package — both require() and import work

element-plus publishes both a CommonJS entry and a native ESM entry (ESM added in 2.0.0). require("element-plus") and import "element-plus" both work on every supported Node.js version and in Bun.

Latest
2.14.5 (Aug 21, 2026)
Module format
Dual (CommonJS + ESM)
Last CommonJS version
2.14.5
Native ESM since
2.0.0
TypeScript types
Bundled
Node engines
not declared
Weekly downloads
618K
License
MIT

Does element-plus@2.14.5 actually load? Runtime test results

Installed and executed on Sep 9, 2026 with require("element-plus") from a CommonJS file and import "element-plus" from an ES module.

Runtimerequire("element-plus")import "element-plus"
Node.js 18✗ failsERR_REQUIRE_ESM✓ works
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 element-plus

ES modules (import)

import elementPlus from "element-plus";

CommonJS (require)

const elementPlus = require("element-plus");

Module format by version

Derived from the type, main and exports fields of every stable release on npm (148 versions; the newest 60 shown).

VersionsFormatFirst published
2.7.2 – 2.14.5Dual (CommonJS + ESM)Apr 26, 2024

Frequently asked

Is element-plus ESM-only?

element-plus@2.14.5 ships CommonJS and ESM builds. element-plus publishes both a CommonJS entry and a native ESM entry (ESM added in 2.0.0). require("element-plus") and import "element-plus" both work on every supported Node.js version and in Bun.

Can I require element-plus?

Yes. element-plus ships a CommonJS entry, so require("element-plus") works on every Node.js version, alongside the native ESM entry for import.

Does element-plus work in Bun?

Yes. import "element-plus" loaded successfully in Bun 1.4 on Sep 9, 2026.

Does element-plus ship TypeScript types?

Yes. element-plus bundles its own type declarations; no @types package is needed.

Links

Other dual (commonjs + esm) packages

Similar popularity