next build stops because of ESLint errors, and next lint is gone
Need to disable some ESLint rulesShort answer
In Next.js 15, next build runs ESLint when it is installed and fails on errors. Fix the code, or turn off the single rule in eslint.config.mjs. Skipping the check with ignoreDuringBuilds is the last option. Next.js 16 removed next lint and the eslint option, so run the ESLint CLI yourself.
Fix it fast
1Find out which cause you have
Run ESLint on its own. It prints the file, line and rule name of every error, and the rule name is what you either fix or switch off.
npx eslint . npx next --version2Match what you see, then jump to its fix
- 1
next build ends with lint errors, while next dev still runs.A rule reports an error that next build treats as a failure (Next.js 15)Fix - 2
ESLint already runs in CI or a pre-commit hook, and the build step repeats the check.You want the build to pass while linting runs elsewhere (Next.js 15)Fix - 3
The lint script that called next lint stops working, or the eslint key in next.config is no longer needed.You upgraded to Next.js 16, where next lint was removedFix
- 1
What does the error look like?
Need to disable some ESLint rulesnext build fails because ESLint reports errorsA lint script that runs next lint no longer works after upgrading to Next.js 16
Cause 1 of 3
A rule reports an error that next build treats as a failure (Next.js 15)
1Check
When ESLint is detected, Next.js 15 fails the production build if errors are present. The rule name printed by ESLint tells you what to change.
npx eslint . --format stylish2Fix
Fix the code if the rule is right. If the rule does not suit your project, change its level in the ESLint config, one rule at a time.
// eslint.config.mjs
import { defineConfig, globalIgnores } from 'eslint/config'
import nextVitals from 'eslint-config-next/core-web-vitals'
export default defineConfig([
...nextVitals,
{
rules: {
'react/no-unescaped-entities': 'off',
},
},
globalIgnores(['.next/**', 'out/**', 'build/**', 'next-env.d.ts']),
])3Verify
Run the same ESLint command and then the build.
npx eslint .
npx next buildConfirmed by nextjs.org
Cause 2 of 3
You want the build to pass while linting runs elsewhere (Next.js 15)
1Check
Check that ESLint really runs in another step, because this setting lets builds succeed even with lint errors.
grep -n "eslint" package.json .github/workflows/*.yml 2>/dev/null2Fix
Turn off the built-in step with ignoreDuringBuilds. The Next.js 15 docs advise this only when linting happens elsewhere in your workflow.
// next.config.js (Next.js 15)
module.exports = {
eslint: {
ignoreDuringBuilds: true,
},
}3Verify
Run the build. It completes, and your CI lint job still reports the errors.
npx next buildConfirmed by nextjs.org
Cause 3 of 3
You upgraded to Next.js 16, where next lint was removed
1Check
Starting with Next.js 16, next lint is removed. The eslint option in the Next config is no longer needed and can be deleted.
grep -n "next lint" package.json
grep -n "eslint" next.config.*2Fix
Install ESLint with eslint-config-next, create eslint.config.mjs, point the lint script at the ESLint CLI and delete the eslint option from next.config.
npm i -D eslint eslint-config-next
# package.json
"scripts": { "lint": "eslint ." }3Verify
Run the new script.
npm run lintConfirmed by nextjs.org
How do I stop it coming back?
- Run npx eslint . in CI as its own step, so lint errors show up before the build.
- Change a rule in eslint.config.mjs with a short comment on why, instead of silencing a whole folder.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Web apps
ESLint fails with: Cannot find module 'next/babel'
ESLint stops on the first file with a Babel or parser error instead of listing lint results
next/babel is a Babel preset that ships inside the next package.
3 causes, each with a fixWeb apps
AuthUserPoolException: Auth UserPool not configured in a Next.js app
Auth UserPool not configured
The error means an Amplify Auth call ran before Amplify.configure did.
3 causes, each with a fixWeb apps
Apollo Server rejects a request as a potential CSRF
HTTP 400 Bad Request from the GraphQL endpoint
Apollo Server's CSRF prevention is on by default.
3 causes, each with a fixWeb apps
Clerk cannot read its publishable key in a Next.js app
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY is undefined
Clerk reads NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY.
3 causes, each with a fixWeb apps
The shell cannot find create-next-app
command not found: create-next-app
create-next-app is not meant to be installed as a shell command.
2 causes, each with a fixWeb apps
ESLint says an element in a list is missing its key prop
react/jsx-key
react/jsx-key fires when an element returned from map, Array.from or an array literal has no key.
3 causes, each with a fix