canirequire › CommonJS › eslint-config-next
Is eslint-config-next ESM-only? Can you require() it?
ESLint configuration used by Next.js.
Last verified Sep 9, 2026 against eslint-config-next@16.3.4. Markdown · JSON
CommonJS CommonJS on paper — require() failed in our runtime test
eslint-config-next declares a CommonJS entry only, but require("eslint-config-next") failed on every Node.js version in our probe: Cannot find module 'next/dist/compiled/babel/eslint-parser'. import "eslint-config-next" resolves to the same file, so it fails the same way. That usually means a missing peer dependency, a browser-only global, or a package that is not meant to be loaded directly; see the runtime table below.
What to do
- require("eslint-config-next") failed in our probe on every Node.js version (Cannot find module 'next/dist/compiled/babel/eslint-parser'); check the package README for peer dependencies or setup before relying on it.
- From ES modules use the default import: import eslintConfigNext from "eslint-config-next"; then destructure. Named imports only work when Node.js can statically detect the exports.
- TypeScript: types are bundled; install nothing extra.
Does eslint-config-next@16.3.4 actually load? Runtime test results
Installed and executed on Sep 9, 2026 with require("eslint-config-next") from a CommonJS file and import "eslint-config-next" from an ES module.
| Runtime | require("eslint-config-next") | import "eslint-config-next" |
|---|---|---|
| Node.js 18 | ✗ failsMODULE_NOT_FOUND | ✗ failsMODULE_NOT_FOUND |
| Node.js 20 | ✗ failsMODULE_NOT_FOUND | ✗ failsMODULE_NOT_FOUND |
| Node.js 22 | ✗ failsMODULE_NOT_FOUND | ✗ failsMODULE_NOT_FOUND |
| Node.js 24 | ✗ failsMODULE_NOT_FOUND | ✗ failsMODULE_NOT_FOUND |
| Node.js 26 | ✗ failsMODULE_NOT_FOUND | ✗ failsMODULE_NOT_FOUND |
| Bun 1.4.0 | ✗ failsError | ✗ failsError |
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 eslint-config-next
ES modules (import)
import eslintConfigNext from "eslint-config-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)
// require("eslint-config-next") failed in our probe on every Node.js version we test (Cannot find module 'next/dist/compiled/babel/eslint-parser'); see the runtime table.
const eslintConfigNext = require("eslint-config-next");Module format by version
Derived from the type, main and exports fields of every stable release on npm, corrected where a runtime test of that version contradicted them (281 versions; the newest 60 shown).
| Versions | Format | First published |
|---|---|---|
| 15.5.3 – 16.3.4 | CommonJS | Sep 10, 2025 |
Frequently asked
Is eslint-config-next ESM-only?
eslint-config-next@16.3.4 declares a CommonJS entry, but require() fails at runtime. eslint-config-next declares a CommonJS entry only, but require("eslint-config-next") failed on every Node.js version in our probe: Cannot find module 'next/dist/compiled/babel/eslint-parser'. import "eslint-config-next" resolves to the same file, so it fails the same way. That usually means a missing peer dependency, a browser-only global, or a package that is not meant to be loaded directly; see the runtime table below.
Can I require eslint-config-next?
Not in practice. eslint-config-next declares a CommonJS entry, but require("eslint-config-next") failed on every Node.js version in our probe: Cannot find module 'next/dist/compiled/babel/eslint-parser'. Check the package README for peer dependencies or setup before relying on it.
Can I import eslint-config-next with ES module syntax?
Yes. import eslintConfigNext from "eslint-config-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 eslint-config-next work in Bun?
Importing eslint-config-next failed in Bun 1.4.0 on Sep 9, 2026: error: Cannot find module 'next/dist/compiled/babel/eslint-parser' from '/Users/boat/Projects/top-seo/data/probe-work/eslint-config-next/node_modules/eslint-config-next/dist/parser.js'
Does eslint-config-next ship TypeScript types?
Yes. eslint-config-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
- read-cache 1.0.2CommonJS
- @protobufjs/inquire 1.1.2CommonJS
- thenify-all 1.6.0CommonJS
- preact 10.29.8Dual
- @smithy/shared-ini-file-loader 4.7.2CommonJS
- classnames 2.5.1CommonJS
- node-int64 0.4.0CommonJS
- handlebars 4.7.9CommonJS