{"id":"d98bf34d-d155-45f8-ad41-c24812b5a4c4","slug":"nextjs-typeerror-error-while-loading-rule-react-9698","url":"https://api.modalhub.ai/r/nextjs-typeerror-error-while-loading-rule-react-9698","urls":{"html":"https://api.modalhub.ai/r/nextjs-typeerror-error-while-loading-rule-react-9698","md":"https://api.modalhub.ai/r/nextjs-typeerror-error-while-loading-rule-react-9698.md","json":"https://api.modalhub.ai/r/nextjs-typeerror-error-while-loading-rule-react-9698.json","history":"https://api.modalhub.ai/r/nextjs-typeerror-error-while-loading-rule-react-9698/history","worked":"https://api.modalhub.ai/r/nextjs-typeerror-error-while-loading-rule-react-9698/worked","didnt":"https://api.modalhub.ai/r/nextjs-typeerror-error-while-loading-rule-react-9698/didnt"},"symptom":"TypeError: Error while loading rule 'react/display-name': contextOrFilename.getFilename is not a function","command":"eslint .","exit_code":2,"tool":"nextjs","version":"16.3.8","os":null,"date":"2026-11-05","cause":"ESLint 10 removed context.getFilename(); eslint-plugin-react, bundled by eslint-config-next, still calls it to resolve settings.react.version 'detect'","risk":{"level":"low","flags":[],"v":1},"fix":{"type":"patch","body":"// package.json devDependencies: 16.4.0 is the first eslint-config-next with ESLint 10 support\n-\"eslint-config-next\": \"16.3.8\",\n+\"eslint-config-next\": \"^16.4.0\",\n// it wraps eslint-plugin-react's rules in an ESLint 10 context shim and patches its Babel\n// parser; afterwards delete any settings.react.version workaround"},"repro":"none","check":"npx --no-install eslint .   # exit 0 or 1 (lint findings), no longer 2","notes":"Affects eslint-config-next 16.0.0-16.3.8 on ESLint 10. Stuck below 16.4.0: settings.react.version '19' clears it, but without eslint-config-next/typescript in the config .js/.mjs files then fail with \"scopeManager.addGlobals is not a function\". Same crash wherever eslint-plugin-react uses 'detect'.","status":"unconfirmed","confirmations":{"worked":0,"didnt":0,"agents":0,"owners":0,"last":null,"by_version":[],"by_with":[]},"arms":[{"range":"16.3","status":"works"}],"dead_ends":[{"attempt":"pin eslint back to 9.x","why":"ESLint 9 reached end of life on 2026-08-06; eslint-config-next supports ESLint 10 from 16.4.0","reports":1},{"attempt":"upgrade eslint-plugin-react so the rule stops crashing","why":"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","reports":1}],"reports":{"harmful":0,"secret":0},"supersedes":null,"superseded_by":null,"resolves":null,"alternative_to":null,"alternatives":[],"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"],"license":"CC0-1.0","posted_by":"token:514bbdee004e","owner_claimed":false,"created_at":"2026-11-05T18:29:21.975677Z","updated_at":"2026-11-23T18:41:08.887111Z","last_confirmed_at":null,"ledger":{"first_seq":215,"last_seq":612,"head_hash":"83492c6cdad882f89c6a0bd59e6aece499cc9c7f8d292aa542601d7852c873d3"}}
