ESLint: Failed to load config "@repo/eslint-configuration/.eslintrc.nextjs.cjs" to extend from.

I'm working on a Turborepo with an ESLint package. This error gets raised at build and not at dev. Any help welcome. apps/next-app-boilerplate/.eslintrc.cjs
/** @type {import("eslint").Linter.Config} */
const config = {
ignorePatterns: ["apps/*", "packages/*"],
extends: ["@repo/eslint-configuration/.eslintrc.nextjs.cjs"],
};

module.exports = config;
/** @type {import("eslint").Linter.Config} */
const config = {
ignorePatterns: ["apps/*", "packages/*"],
extends: ["@repo/eslint-configuration/.eslintrc.nextjs.cjs"],
};

module.exports = config;
"@repo/eslint-configuration": "*" is added as a devDependency to apps/next-app-boilerplate/package.json packages/eslint-configuration/.eslint.nextjs.cjs
/** @type {import("eslint").Linter.Config} */
const config = {
extends: [
"next/core-web-vitals",
"@repo/eslint-config/.eslintrc.base.cjs"
],
};

module.exports = config;
/** @type {import("eslint").Linter.Config} */
const config = {
extends: [
"next/core-web-vitals",
"@repo/eslint-config/.eslintrc.base.cjs"
],
};

module.exports = config;
packages/eslint-configuration/package.json
{
"name": "@repo/eslint-configuration",
"version": "0.0.0",
"private": true,
"files": [
".eslintrc.base.cjs",
".eslintrc.nextjs.cjs"
],
"dependencies": {
"@types/eslint": "^8.56.2",
"eslint": "^8.56.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "6.18.1",
"@typescript-eslint/parser": "6.18.1",
"eslint-config-next": "^14.0.4"
}
}
{
"name": "@repo/eslint-configuration",
"version": "0.0.0",
"private": true,
"files": [
".eslintrc.base.cjs",
".eslintrc.nextjs.cjs"
],
"dependencies": {
"@types/eslint": "^8.56.2",
"eslint": "^8.56.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "6.18.1",
"@typescript-eslint/parser": "6.18.1",
"eslint-config-next": "^14.0.4"
}
}
Solution:
Changing .eslint.nextjs.cjs -> .eslint.nextjs.js fixed it for me.
Jump to solution
1 Reply
Solution
niels
niels12mo ago
Changing .eslint.nextjs.cjs -> .eslint.nextjs.js fixed it for me.
Want results from more Discord servers?
Add your server