AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

ESLint V10 Incompatibility With Eslint-Plugin-React Causing TypeError: ContextOrFilename.GetFilename Is Not A Function

Upgrading ESLint to v10 in a Next.js project causes linting to fail with a TypeError originating from eslint-plugin-react's version detection logic, which calls a removed or changed `getFilename` method on the rule context.

highConfidence 85%Next.jsReact Server ComponentsHydrationAffected Veslint: 10.0.0Affected Vnext: 16.1.6Affected Veslint-Plugin-React: 7.x (inferred)

Origin Analysis

ESLint v10 has changed the RuleContext API, removing or altering the `getFilename` method, while eslint-plugin-react (likely version 7.x) still expects it, leading to a call on an incompatible object (possibly a string) and crashing the rule loader.
1. Create a Next.js project (e.g., v16.1.6). 2. Upgrade ESLint to v10.0.0. 3. Run `eslint` (or `next lint`). 4. Observe TypeError: contextOrFilename.getFilename is not a function when loading the 'react/display-name' rule.

Fixing Code Block

Edge Case Audit

This is a temporary workaround that only prevents the crash for this specific rule. Other eslint-plugin-react rules or other plugins may still have incompatibilities with ESLint v10. The hardcoded React version must be kept in sync with the actual React version; otherwise rule behavior may be incorrect. Recommended long-term fix: upgrade eslint-plugin-react to a version that officially supports ESLint v10 (if available) or downgrade ESLint to v9. To rollback, remove the settings block and revert to ESLint 9.x.

Ecosystem Topology

Agent Frameworks

LangChain, LlamaIndex, and Pydantic

  1. highProperty graph relation keys collide when entity IDs or labels contain underscores
  2. highCodeActAgent drops assistant tool-call metadata during handoff, leaving an orphan tool response
  3. high[Bug]: HierarchicalNodeParser async methods return the documents unsplit
  4. highLLM.predict_and_call fails with ValidationError for non-function-calling models when react_chat_formatter is omitted
  5. highAnthropic streaming server-tool input_json_delta overwrites completed client tool_use arguments due to stale cur_tool_call state