vercel / vercel/next.js

[ESLint v10]: TypeError: contextOrFilename.getFilename is not a function when running ESLint v10

Open
#89,764 28 comments 99 reactions 1 assignee View on GitHub

@icyJoseph is already working on this.

Since Mar 16, 2026.

linear: next Linting Upstream
Dominant language
JavaScript
Stars
142k
Forks
32.4k
Avg merge
2d 14h
Merged PRs (30d)
351

Description

Link to the code that reproduces this issue

https://github.com/bennajah/nextjs16

To Reproduce
  1. Create a next.js project or clone this repo
  2. Upgrade eslint to v10 .
  3. Run eslint
Current vs. Expected behavior

After upgrading ESLint to v10 in a Next.js project, running bun eslint causes the following error:

PS C:\Users\benna\dev\my-app> bun lint
$ eslint

Oops! Something went wrong! :(

ESLint: 10.0.0

TypeError: Error while loading rule 'react/display-name': contextOrFilename.getFilename is not a function
Occurred while linting C:\Users\benna\dev\my-app\app\layout.tsx
    at resolveBasedir (C:\Users\benna\dev\my-app\node_modules\eslint-plugin-react\lib\util\version.js:31:100)
    at detectReactVersion (C:\Users\benna\dev\my-app\node_modules\eslint-plugin-react\lib\util\version.js:85:19)
    at getReactVersionFromContext (C:\Users\benna\dev\my-app\node_modules\eslint-plugin-react\lib\util\version.js:116:25)
    at testReactVersion (C:\Users\benna\dev\my-app\node_modules\eslint-plugin-react\lib\util\version.js:181:28)
    at usedPropTypesInstructions (C:\Users\benna\dev\my-app\node_modules\eslint-plugin-react\lib\util\usedPropTypes.js:307:36)
    at Components.componentRule (C:\Users\benna\dev\my-app\node_modules\eslint-plugin-react\lib\util\Components.js:940:37)
    at createRuleListeners (C:\Users\benna\dev\my-app\node_modules\eslint\lib\linter\linter.js:497:15)
    at C:\Users\benna\dev\my-app\node_modules\eslint\lib\linter\linter.js:623:7
    at Array.forEach (<anonymous>)
    at runRules (C:\Users\benna\dev\my-app\node_modules\eslint\lib\linter\linter.js:557:31)
Provide environment information
Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 12244
  Available CPU cores: 8
Binaries:
  Node: 24.13.0
  npm: 11.6.2
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 16.1.6 // Latest available version is detected (16.1.6).
  eslint-config-next: N/A
  react: 19.2.4
  react-dom: 19.2.4
  typescript: 5.9.3
Next.js Config:
  output: N/A
Which area(s) are affected? (Select all that apply)

Linting

Which stage(s) are affected? (Select all that apply)

Other (Deployed)

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.