canirequire › Dual (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.
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.
| Runtime | require("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).
| Versions | Format | First published |
|---|---|---|
| 2.7.2 – 2.14.5 | Dual (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
- 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
- jest-styled-components 7.4.0CommonJS
- babel-plugin-transform-flow-strip-types 6.22.0CommonJS
- watch 1.0.2CommonJS
- rollup-plugin-sourcemaps 0.6.3Dual
- coveralls 3.1.1CommonJS
- babel-plugin-transform-react-jsx 6.24.1CommonJS
- uglify-es 3.3.9CommonJS
- eslint-plugin-markdown 5.1.0CommonJS