canirequire › CommonJS › @alifd/next
Is @alifd/next ESM-only? Can you require() it?
A configurable component library for web built on React.
Latest version 1.27.34, published Mar 31, 2026. JSON
CommonJS CommonJS — require() works on every Node.js version
@alifd/next ships CommonJS only. require("@alifd/next") works everywhere. import "@alifd/next" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.
It also declares a "module" field, so bundlers such as webpack, Vite and esbuild pick up an ESM build for tree-shaking.
Does @alifd/next@1.27.34 actually load? Runtime test results
Runtime probe pending for this version. The values below are what package.json declares; they are refreshed once the probe runs.
| Runtime | require("@alifd/next") | import "@alifd/next" |
|---|---|---|
| Node.js 18 | ✓ expected | ✓ expected |
| Node.js 20 | ✓ expected | ✓ expected |
| Node.js 22 | ✓ expected | ✓ expected |
| Node.js 24 | ✓ expected | ✓ expected |
| Node.js 26 | ✓ expected | ✓ expected |
| Bun 1.4 | pending | pending |
Install failed in our sandbox: error: ConnectionRefused downloading package manifest @alifd/next The rows above show what package.json declares.
How to import @alifd/next
ES modules (import)
import next from "@alifd/next";Named imports from a CommonJS package only work when Node.js can statically detect them. If a named import fails, use the default import and destructure.
CommonJS (require)
const next = require("@alifd/next");Module format by version
Derived from the type, main and exports fields of every stable release on npm (436 versions; the newest 60 shown).
| Versions | Format | First published |
|---|---|---|
| 1.26.13 – 1.27.34 | CommonJS | Feb 27, 2023 |
Frequently asked
Is @alifd/next ESM-only?
@alifd/next@1.27.34 is a CommonJS package. @alifd/next ships CommonJS only. require("@alifd/next") works everywhere. import "@alifd/next" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.
Can I import @alifd/next with ES module syntax?
Yes. import next from "@alifd/next" works in Node.js and Bun because they support importing CommonJS modules. Named imports work only when Node.js can statically detect the exports.
Does @alifd/next ship TypeScript types?
Yes. @alifd/next bundles its own type declarations; no @types package is needed.
Links
Other commonjs packages
- debug 4.4.3CommonJS
- semver 7.8.5CommonJS
- ms 2.1.3CommonJS
- picomatch 4.0.7CommonJS
- ajv 8.20.0CommonJS
- source-map 0.8.0CommonJS
- react-is 19.2.8CommonJS
- readable-stream 4.7.0CommonJS
Similar popularity
- @webcomponents/webcomponentsjs 2.8.0CommonJS
- @size-limit/preset-small-lib 13.0.3ESM-only
- @ant-design/web3-common 1.23.0Dual
- @ant-design/web3-icons 1.16.0Dual
- @angular/http 7.2.16CommonJS
- @alifd/babel-preset-next 2.0.0-betaCommonJS
- @release-it/conventional-changelog 12.0.0ESM-only
- @vue/eslint-config-standard 9.0.1ESM-only