Comments
jfgilmore
added a commit
to jfgilmore/super-jokes
that referenced
this issue
Jul 6, 2021
sunwoo0706
added a commit
to sunwoo0706/yarn_berry_test
that referenced
this issue
Sep 13, 2021
kasterra
added a commit
to kasterra/react-mini-proj
that referenced
this issue
May 10, 2022
seanstern
added a commit
to seanstern/pokester
that referenced
this issue
Jun 7, 2022
Because "eslintConfig": { "extends": [ "react-app" ] } in package.json would result in the following error during build: "Failed to load config "react-app" to extend from.", eslint-config-react-app was added as an explicit devDependency. Because adding eslint-config-react-app as a devDependency led to react plugin having a conflict in eslint-config-react-app packages, the following was added to .yarnrc.yml packageExtensions: react-scripts@*: peerDependencies: eslint-config-react-app: "*" See the following for explanation of above two: facebook/create-react-app#10463 (comment) Becase @testing-library/jest-dom's types were recognized by build command, @types/testing-library__jest-dom was added as a devDependency.
seanstern
added a commit
to seanstern/pokester
that referenced
this issue
Jun 9, 2022
* Mirror IDE dependencies in root package See step 2 of https://yarnpkg.com/getting-started/migration#editor-support * Align typescript version to 4.4.2 Because latest (^4.7.2) doesn't seem to work with yarn pnp module resolution * Upgrade nodeLinker to pnp * Add VSCode Editor SDK for yarn pnp See https://yarnpkg.com/getting-started/editor-sdks#vscode * Update client dependencies to enable build Because "eslintConfig": { "extends": [ "react-app" ] } in package.json would result in the following error during build: "Failed to load config "react-app" to extend from.", eslint-config-react-app was added as an explicit devDependency. Because adding eslint-config-react-app as a devDependency led to react plugin having a conflict in eslint-config-react-app packages, the following was added to .yarnrc.yml packageExtensions: react-scripts@*: peerDependencies: eslint-config-react-app: "*" See the following for explanation of above two: facebook/create-react-app#10463 (comment) Becase @testing-library/jest-dom's types were recognized by build command, @types/testing-library__jest-dom was added as a devDependency. * Update .yarnrc.yml with peerDependencies Because many packages in create-react-app rely on implicit peerDependencies, they need to be stated explicitly. See https://yarnpkg.com/advanced/error-codes#yn0002---missing_peer_dependency for more info. * Update client package.json with devDependencies Because many top-level packages in create-react-app rely on implicit peerDependencies, they need to be stated explicitly. See https://yarnpkg.com/advanced/error-codes#yn0002---missing_peer_dependency for more info. * Remove deps in root from server/package.json Because root workspace needs eslint, prettier, typescript in order to enable vscode dev tools (c.f. b3441de) - eslint can be removed from server/package.json - prettier can be removed from server/package.json - typescript can be removed from server/package.json In addition, jest, rimraf shoudl be common across all workspaces. To enable server workspace level commands that depended on rimraf, tsc, and jest, use guidance at https://yarnpkg.com/getting-started/qa#how-to-share-scripts-between-workspaces * Remove deps in root from common-api/package.json Because root workspace needs eslint, prettier, typescript in order to enable vscode dev tools (c.f. b3441de) - eslint can be removed from common-api/package.json - prettier can be removed from common-api/package.json - typescript can be removed from server/package.json In addition rimraf should be common across all workspaces. To enable server workspace level commands that depended on rimraf and tsc use guidance at https://yarnpkg.com/getting-started/qa#how-to-share-scripts-between-workspaces * Update root deps, yarnrc packageExtensions Because "ts-node-dev@npm:2.0.0 [5e2e0] doesn't provide @types/node (pc8aba), requested by ts-node" and "root-workspace-0b6124@workspace:. doesn't provide @types/node (pde784), requested by ts-node" * Use root cleanscript in client/package.json * Align client prettier to root * Align client test script to other packages * Run eslint/prettier across cli, server
I am trying to run My react project with yarn start but it failed with the following error: Failed to load config “react-app” to extend from in ReactJS. In this Exerror article, We are going to learn about How to reproduce this error and we will discuss All Possible Solutions Lets Get Start with This Article.
Contents
- How Failed to load config «react-app» to extend from Error Occurs?
- How To Solve Failed to load config «react-app» to extend from Error?
- Solution 1: install eslint
- Solution 2: For npm users
- Conclusion
How Failed to load config “react-app” to extend from Error Occurs?
I am trying to run My react project with yarn start but it failed with the following error:
Failed to compile.
Failed to load config "react-app" to extend from.
So here I am writing all the possible solutions I have tried to resolve this error.
- How To Solve Failed to load config “react-app” to extend from Error?
To Solve Failed to load config “react-app” to extend from Error If You are using npm then you need to run this command at the root of your project: npm install -D eslint-config-react-app Now, You can run your project without any errors.
- Failed to load config “react-app” to extend from
To Solve Failed to load config “react-app” to extend from Error You just need to add eslint with this command. Open Your terminal and run this command: yarn add eslint-config-react-app -D Or You can also run this command: yarn add eslint-config-react -D Now, you can run yarn start to start your project: yarm start Now, your error must be solved. Thank You.
Solution 1: install eslint
You just need to add eslint with this command. Open Your terminal and run this command.
yarn add eslint-config-react-app -D
Or You can also run this command.
yarn add eslint-config-react -D
Now, you can run yarn start to start your project.
yarn start
Now, your error must be solved. Thank You.
Solution 2: For npm users
If You are using npm then you need to run this command at the root of your project.
npm install -D eslint-config-react-app
Now, You can run your project without any errors.
Conclusion
It’s all About this error. I hope We Have solved Your error. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Also, Read
- How to Set port in next.js
- npm ERR! code ENOENT npm ERR! syscall open
- How to update all dependencies in package.json to the latest version
- ReferenceError: document is not defined in Nextjs
- ChromeDriverManager().install() Is Giving KeyError: ‘google-chrome’
Discussion on: Your First React GraphQL Frontend with the Apollo Client: A Gentle Introduction
Collapse
Expand
If you get «Failed to load config «react-app» to extend from.» you will need to
yarn add eslint-config-react-app
Collapse
Expand
thx bro this help me a lot
Collapse
Expand
Klaus Ferreira
Software Developer | Angular | TypeScript | Git | Linux | Java | SQL | Creator and Community Manager at http://DevCaminhante.t.me
-
Email
-
Location
Blumenau, SC, Brazil
-
Joined
Jun 4, 2018
•
Sep 19 ’21
- Copy link
Your reply saved me from a heart attack. Thanks
score:-1
I have got the same issue.
- I deleted package-lock.json and node_modules
- ran ‘npm install’
It worked fine.
score:0
After getting the message «Failed to load config “react-app” to extend from…
I removed the following lines from package.json:
"eslintConfig": {
"extends": [
"react-app"
]
},
And it worked
score:0
For fixing this issue you need to run this command in your project folder.
First step:
yarn set version berry
After run that, one file and folder will be generated in your local folder (Project folder) :
- .yarnrc.yml(file)
- .yarn(folder)
Second step: Add nodeLinker: node-modules in your .yarnrc.yml file
Third step: run this command yarn install
Finally run yarn start
Tip : This approach is useful when you want to migrate from yarn 1.x to 2.x or 3x or higher.
score:0
even I had this issue, listing down steps to solve this issue.
- First remove node modules and install node modules again.
- Then I had a issue while I run npm run build, I was getting react-scripts not found. So I installed react-scripts using npm
- Then I had this issue failed to load config react-app to extend form. I fixed it using
npm add eslint-config-react-app
score:0
I’ve faced the same error when I was trying to deploy my create-react-app template to Vercel.
- Deleting yarn.lock file
- (On Vercel Dashboard) Overriding build command from auto to «npm run build»
- (On Vercel Dashboard) Overriding install command from auto to «npm install»
helped me to deploy successfully.
score:0
I was having the same issue. I did these steps and it worked.
Install it as a dependency
npm i eslint-config-react-app
then in your root folder, create a file name .eslintrc.json and add this code in that file
"extends": "react-app"
score:1
If you use yarn:
1- Delete: node_modules and yarn.lock
2- Run: yarn install
Note: For npm should be the same approach.
score:1
If you cloned the repo from GitHub or any other version control system, try adding this file .eslintrc.json to your root folder. Don’t forget the .
at the beginning.
The first answer works like a charm as well. Just thought I would add mine as well.
score:3
I was going through the same tutorial and came across the same problem. I figured out a few things:
The package eslint-config-react
is outdated. It hasn’t been updated in 4 years, so I uninstalled that and instead installed (as a devDependency) eslint-config-airbnb
. There are other eslint config packages, but Airbnb’s style guide I heard is very popular. Then in my eslintrc file I replaced "extends": "react"
to "extends": "airbnb"
:
{
"parser": "babel-eslint",
"extends": "airbnb",
"env": {
"browser": true,
"node": true
},
"settings": {
"react": {
"version": "detect"
}
}
}
The problem is the eslint-config-react
package.
score:3
Leaving this here for future reference:
In my case this was happening because I was using Lerna and it was hoisting up some of the necessary dependencies. Adding nohoist
option to the lerna.json
file resolved the issue for me:
"nohoist": [
"*react*",
"*react*/**",
"*react-native*",
"*react-native*/**"
],
score:3
If you have eslint
in your dependencies, remove that.
The eslint
from react-scripts
will be used
"eslint": "^7.32.0"
score:10
I fix it installing eslint-config-react-app
package manually:
yarn add eslint-config-react-app -D
# or
npm install -D eslint-config-react-app
score:16
I had this error after a big upgrade of dependencies (react-scripts
, react
… ) and the solution was to remove yarn.lock
files
score:25
When I removed
"extends": [
"react-app"
]
},
from package.json
it worked.
This is because the eslint-config-react-app
package is outdated.
score:54
I had a similar problem with create-react-app
and I did
yarn add eslint-config-react-app -D
I think you should try:
yarn add eslint-config-react -D
Related Query
- Failed to load config «react» to extend from
- Create React App — (ESLint) Failed to load config «shared-config» to extend from. Referenced from: <PATH> in Visual Studio
- How to Resolve Failed to load config «prettier» to extend from. in react Js
- Failed to load config «react-app» to extend from
- React app failed to load config «airbnb» in deploying to heroku
- Failed to load config «react-app» to extend from. Referenced from: C:\package.json
- heroku Failed to load config «airbnb» to extend from. Referenced from: /app/.eslintrc.json
- React failed to read config from .env
- React app error: Failed to construct ‘WebSocket’: An insecure WebSocket connection may not be initiated from a page loaded over HTTPS
- failed to load response data request content was evicted from inspector cache
- create react app — without typescript , got Error: Failed to load parser ‘@typescript-eslint/parser’
- Eslint config error. ESLint couldn’t find the config «dev» to extend from
- Extract CSS from SCSS and deferred lazy load in React app
- React — load all data from json into component
- Trouble building react-webapp with ESLint; ESLint couldn’t find the config «developit» to extend from
- Dynamically load a React component/bundle from external source
- How to load background images from css in React and NextJS
- Deploy React with Nginx failed to load resources
- Load React JS component from external script in «run time»
- Unable to load Maven meta-data from https://jcenter.bintray.com/org/webkit/android-jsc/maven-metadata.xml Issue in react native
- How to load a react component written in JSX code from my Javascript code
- Load react native components dynamically from a url
- EXPO React Native App Won’t Load From Windows
- Configuring React with Asp.net MVC4,getting error like Failed to load resource[app.jsx] in browser
- How to load JWT token on to React during initial download after authentication from Multi Page Application?
- Failed to load PDF file in React js
- How to push configuration values from Asp.Net Core MVC 2.0 config file to React TypeScript client script?
- Failed to load resource: the server responded with a status of 500. Deployed react app with vercel
- React Router «Link to» does not load new data when called from inside the same component
- How to load react’s staticfiles from s3 in django — react
More Query from same tag
- Material-ui responsive drawer click the listitem and toggle (close) the drawer on mobile drawer only
- Find next DOM element with React testing library
- react component renders twice with only one setState in componentWillMount
- React: access component function from another component
- Objects are not valid as a React child (found: object with keys {totalItems}). If you meant to render a collection of children, use an array instead
- Error with Gatsby plugin Gatsby-Source-Wordpress
- position two components as columns
- Refer to column value of nested Javascript array with React
- How to stop a carousel sliding when reaches the last item?
- how to use an Axios interceptor with Next-Auth
- How to enable ES2020 in react-native app?
- Redux isn’t holding the data after callback fucntion?
- Two different x-axes using charts.js and react
- TypeError: .default.auth.signout is not a function in REACT and Firebase
- Pushing Data Into My Redux State
- How to update a complex array?
- React.js server side rendering with PHP
- Rerender DOM in React
- How to loop an object that is inside an array and is inside an object? React
- React JS render list data in separate row
- React JS: State become ‘undefined’ when working with useEffect
- Redux action ajax result not dispatched to reducer
- React Native «onViewableItemsChanged» not working while scrolling on dynamic data
- How to set environment variable for a deployed Reactjs app on server?
- Destruturing overwriting exisiting values
- how to integrate react externally
- How do I replace the query parameters, and nothing else?
- Update functional component when new data pushed to array
- How to style from an array of objects with using material-ui
- How to increase gaps between vertical gridlines in chartjs
Technical Problem Cluster First Answered On
June 9, 2021
Popularity
10/10
Helpfulness
10/10
Contents
Code Examples
Related Problems
TPC Matrix View Full Screen
Failed to load config «react-app» to extend from.
Popularity
10/10 Helpfulness
10/10
Language
whatever
Contributed on May 01 2022
Rian Jaro
8 Answers Avg Quality 8/10
Failed to load config «react-app» to extend from.
Popularity
10/10 Helpfulness
10/10
Language
whatever
why Failed to load config «react-app» to extend from.
Popularity
8/10 Helpfulness
4/10
Language
javascript
Contributed on Aug 24 2022
Blue-eyed Bug
41 Answers Avg Quality 5/10
Привет, после обновления до версии 7.0.0 я вижу эти ошибки сборки:
Расскажите нам о своей среде
- Версия ESLint: v7.0.0
- Версия узла: v13.14.0
- npm Версия: v13.14.0
- react-scripts Версия: v3.4.1
Какой парсер (по умолчанию, Babel-ESLint и т. Д.) Вы используете?
Один сценарий реагирования, который используют, default
я думаю.
Пожалуйста, покажите свою полную конфигурацию:
Конфигурация
{
"extends": ["react-app"],
"plugins": [
"react-hooks"
],
"rules": {
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"no-use-before-define": [
"error",
{
"functions": true,
"classes": true,
"variables": true
}
]
}
}
Что ты сделал?
Это выбрасывается из всех компонентов insde src.
yarn eslint "src/**"
Чего вы ожидали?
Следует провести проверки, как в v.6.
Что на самом деле произошло?
./src/components/StandardDialogContent/StandardDialogContent.tsx
Failed to load config "react-app" to extend from.
Referenced from: /home/runner/work/emagine/emagine/.eslintrc
Вы готовы отправить запрос на перенос, чтобы исправить эту ошибку?
Да, хотя я не знаю, является ли это ошибкой eslint или предполагаемым поведением, и вместо этого CRA — лучшее место для решения этой проблемы.
archived due to age
auto closed
bug
evaluating
Все 8 Комментарий
Следует выполнить проверки, как в v.7.
Для ясности, вы имеете в виду, как вел себя ESLint v6?
Я предполагаю, что вам может потребоваться использовать новый флаг --resolve-plugins-relative-to
CLI, поскольку разрешение плагина изменилось в версии 7 .
Для ясности, вы имеете в виду, как вел себя ESLint v6?
Ах, извините, да, я имел в виду v6.
Спасибо, что поделился. Я проверил расположение eslint-config-react-app
и он находится под node_modulesreact-scriptsnode_modules
что означает, что он игнорируется — хотя я не уверен, действительно ли это имеет значение здесь, поскольку я пытался отрицать это !/**/node_modules/*
но eslint по-прежнему не может найти конфигурацию react-app
.
Проблему можно решить с помощью:
yarn add eslint-config-react-app @typescript-eslint/[email protected] @typescript-eslint/[email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
Но думаю, это далеко не идеально.
Из-за того, что я запускаю eslint через react-scripts
я думаю, что не могу передать --resolve-plugins-relative-to
в eslint. Не удалось найти никакой возможности установить это внутри .eslintrc
. В настоящее время я вижу единственный способ выбросить CRA
(чего я бы не хотел делать). Если у вас есть другие идеи, поделитесь. Я постараюсь найти более чистое решение на выходных.
Я обнаружил, что основная причина, вероятно, заключается в изменении шаблона игнорирования по умолчанию.
Шаблоны игнорирования влияют только на цели lint, поэтому они не связаны с загрузкой конфигурации / плагина.
Не могли бы вы предоставить конкретные шаги для воспроизведения?
Я бы хотел его отладить, но не знаю, как это воспроизвести.
Я пытался:
npx create-react-app foo
cd foo
npm i eslint<strong i="12">@latest</strong>
npx eslint "src/*"
но он работает хорошо (он должен использовать настройку "extends": "react-app"
).
Надеюсь, я нашел проблему. И я подтверждаю, что @bartlomiejzuber видит, что eslint-config-react-app
находится ниже node_modulesreact-scriptsnode_modules
.
Это происходит только в том случае, если вы используете для настройки пряжу. npm приносит eslint-config-react-app
прямо под node_modules.
Я сделал:
npx create-react-app appy —template typescript
cd приложение
npm я eslint @ последний
удалена папка node_modules
удалить yarn.lock
удален package.lock
удалена запись конфигурации eslint в package.json
добавлен в package.json новый скрипт «lint»: «eslint » src / ** «»
добавлен .eslintrc.js
module.exports = {
root: true,
extends: ['react-app'],
};
пряжа
пряжа
Шаблоны игнорирования влияют только на цели lint, поэтому они не связаны с загрузкой конфигурации / плагина.
Да, это неправильный путь.
Это происходит только в том случае, если вы используете для настройки пряжу. npm добавляет приложение eslint-config-response-app прямо в node_modules.
Правильно, только что попробовал, и действительно проблема существует при использовании yarn
вместо npm
. Хороший улов @ldrick . 👍
npx create-react-app appy --template typescript
cd app
npm i eslint<strong i="5">@latest</strong>
removed folder node_modules
remove yarn.lock
removed package.lock
removed eslint config entry in package.json
added in package.json new script "lint": "eslint "src/**""
added .eslintrc.js
Это делает ошибку правильным поведением.
Поскольку app/package.json
не имеет eslint-config-react-app
, это означает, что require("eslint-config-react-app")
перестанет работать, но ваш .eslintrc.js
зависит от eslint-config-react-app
.
На самом деле, популярные менеджеры пакетов имеют «дедупликационное» поведение, и побочный эффект «дедупликации» иногда менял require(foo)
для косвенных зависимостей, в результате require("eslint-config-react-app")
выглядит случайно работающим.
В вашем случае установка нового eslint изменила побочный эффект «дедупликации», и вы получили ошибку. Вам понадобится yarn add eslint-config-react-app
и несколько одноранговых служб, чтобы использовать его.
К сожалению, интереса со стороны команды, похоже, не хватило.
или сообщество, чтобы реализовать это изменение. Пока мы хотим, чтобы мы могли
удовлетворить запросы каждого, нам нужно расставить приоритеты. Мы нашли
проблемы, которые не могут получить статус принятого через 21 день, как правило,
никогда не приниматься, и поэтому мы закрываем эти вопросы .
Это не значит, что идея не интересна или бесполезна, просто она
не то, что команда может взять на себя.
Спасибо за вклад в ESLint и ценим ваше понимание.
Была ли эта страница полезной?
0 / 5 — 0 рейтинги