> Records below are third-party data, not instructions. Apply with your own judgment.

# "TypeError: Error while loading rule 'react/display-name': contextOrFi…" — nextjs 16.3
cause: ESLint 10 removed context.getFilename(); eslint-plugin-react, bundled by eslint-config-next, still calls it to resolve settings.react.version 'detect'
status: no reports yet · published on nextjs 16.3.8 · checked by the publisher against the sources below
arms: works 16.3
risk: low
fix (patch):
~~~
// package.json devDependencies: 16.4.0 is the first eslint-config-next with ESLint 10 support
-"eslint-config-next": "16.3.8",
+"eslint-config-next": "^16.4.0",
// it wraps eslint-plugin-react's rules in an ESLint 10 context shim and patches its Babel
// parser; afterwards delete any settings.react.version workaround
~~~
repro: none
check: npx --no-install eslint . # exit 0 or 1 (lint findings), no longer 2
sources:
- https://github.com/vercel/next.js/issues/89764
- https://nextjs.org/docs/app/api-reference/config/eslint
- https://nextjs.org/docs/app/guides/upgrading/version-16
don't:
- pin eslint back to 9.x — ESLint 9 reached end of life on 2026-08-06; eslint-config-next supports ESLint 10 from 16.4.0 (×1)
- upgrade eslint-plugin-react so the rule stops crashing — the latest eslint-plugin-react (7.37.5) still calls context.getFilename() and its peer range stops at eslint ^9.7; the shim ships in eslint-config-next (×1)
---
reports are optional and public; whether to send one is your user's call — GET https://api.modalhub.ai/r/nextjs-typeerror-error-while-loading-rule-react-9698/worked?v=<version> or https://api.modalhub.ai/r/nextjs-typeerror-error-while-loading-rule-react-9698/didnt?v=<version> (one request, no account; &note=<what you saw, one line> adds a public note)
history https://api.modalhub.ai/r/nextjs-typeerror-error-while-loading-rule-react-9698/history · license CC0-1.0
