ESLint cannot load a config called react
Failed to load config "react" to extend from.Short answer
A bare name in extends makes ESLint look for an npm package called eslint-config-react, which does not exist. The React rules come from the eslint-plugin-react package and are referenced as plugin:react/recommended. Install the plugin and change the extends entry. On ESLint 9 and later, use eslint.config.js instead.
Fix it fast
1Find out which cause you have
Check your ESLint version and which config file it reads. Version 9 uses eslint.config.js by default; older setups use .eslintrc files.
npx eslint --version ls .eslintrc* eslint.config.* 2>/dev/null2Match what you see, then jump to its fix
- 1
Your .eslintrc has extends with the plain word reactextends uses react, not plugin:react/recommendedFix - 2
The extends value is already plugin:react/recommendedeslint-plugin-react is not installedFix - 3
ESLint 9 and a leftover string extends in a config fileAn eslintrc config used with ESLint 9 or laterFix
- 1
What does the error look like?
Failed to load config "react" to extend from.
Cause 1 of 3
extends uses react, not plugin:react/recommended
1Check
In eslintrc, an extends value that is an npm name is a shareable config. The React preset is part of the plugin.
grep -n -A4 "extends" .eslintrc*2Fix
Use the plugin preset. Add the jsx-runtime preset as well when you use React 17 or later with the new JSX transform.
{
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime"
]
}3Verify
Run ESLint.
npx eslint srcConfirmed by github.com
Cause 2 of 3
eslint-plugin-react is not installed
1Check
Look in node_modules.
npm ls eslint-plugin-react2Fix
Install it as a development dependency.
npm install eslint eslint-plugin-react --save-dev3Verify
Run ESLint.
npx eslint srcConfirmed by github.com
Cause 3 of 3
An eslintrc config used with ESLint 9 or later
1Check
Flat config is the default since ESLint 9.0.0 and drops string based extends. Configs are imported as modules.
ls eslint.config.*2Fix
Import the plugin config and add it to the exported array.
// eslint.config.js
const js = require('@eslint/js');
const reactPlugin = require('eslint-plugin-react');
module.exports = [
js.configs.recommended,
reactPlugin.configs.flat.recommended,
reactPlugin.configs.flat['jsx-runtime'],
];3Verify
Run ESLint.
npx eslint srcConfirmed by eslint.org
How do I stop it coming back?
- Use plugin: prefixed names for any config that comes from a plugin.
- Set settings.react.version to detect so the plugin reads the installed version.
- Pin ESLint's major version, and read the migration guide before you raise it.
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:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- TaskvareA task and project-management suite: React on the web, Flutter on mobile, TypeScript underneath.
Related fixes
Web apps
ESLint cannot parse your JSX or modern syntax
Parsing error: Unexpected token =
ESLint's built-in parser reads JSX only when ecmaFeatures.jsx is on, and it only lints file types your config lists.
3 causes, each with a fixWeb apps
Module not found for antd/dist/antd.less after upgrading to Ant Design 5
Module not found: Error: Can't resolve 'antd/dist/antd.less'
Ant Design 5 dropped Less and the bundled CSS file for CSS-in-JS, so antd/dist/antd.less no longer exists.
3 causes, each with a fixWeb apps
Astro Code component fails inside a React component
Astro components cannot be rendered directly via function call
Astro components such as Code only exist on the server and render static HTML.
2 causes, each with a fixWeb apps
React shows Attempted import error when importing a component or function
Attempted import error:
The build found the file but not the name you asked for.
2 causes, each with a fixWeb apps
How to catch and handle a 422 from Axios in a Redux thunk
action.error.message is 'Rejected' and action.payload is undefined
A 422 means the server read the request but cannot process its content, so repeating it unchanged fails again.
4 causes, each with a fixWeb apps
axios gets 429 Too Many Requests from a React app
429 (Too Many Requests)
A 429 comes from the server or an API gateway, not from axios: your client sent too many requests in a window.
4 causes, each with a fix