canirequire

canirequireCommonJS › @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.

Latest
1.27.34 (Mar 31, 2026)
Module format
CommonJS
Last CommonJS version
1.27.34
TypeScript types
Bundled
Node engines
not declared
License
MIT

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.

Runtimerequire("@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.4pendingpending

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

VersionsFormatFirst published
1.26.13 – 1.27.34CommonJSFeb 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

Similar popularity