Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

466
Visualizações
Failed to load config "react" to extend from

I am trying to create a react app without using create-react-app using the following website:

https://www.freecodecamp.org/news/how-to-set-up-deploy-your-react-app-from-scratch-using-webpack-and-babel-a669891033d4/

however, I keep getting this error that says

WARNING in ./src/index.js Module Warning (from ./node_modules/eslint-loader/dist/cjs.js): Failed to load config "react" to extend from.

I have tried installing all the dependencies and have spent hours googling an answer, but I can't seem to figure out the problem.

This is my package.json:

{
  "name": "xxx",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "webpack-dev-server --mode development",
    "format": "prettier --write \"src/**/*.js\"",
    "eslint-fix": "eslint --fix \"src/**/*.js\"",
    "build": "webpack --mode production"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@babel/plugin-proposal-class-properties": "^7.10.4",
    "react": "^16.13.1",
    "react-bootstrap": "^1.3.0",
    "react-dom": "^16.13.1"
  },
  "devDependencies": {
    "@babel/core": "^7.11.6",
    "@babel/preset-env": "^7.11.5",
    "@babel/preset-react": "^7.10.4",
    "babel-eslint": "^10.1.0",
    "babel-loader": "^8.1.0",
    "css-loader": "^4.3.0",
    "eslint": "^7.9.0",
    "eslint-config-react": "^1.1.7",
    "eslint-loader": "^4.0.2",
    "eslint-plugin-react": "^7.20.6",
    "html-webpack-plugin": "^4.4.1",
    "less": "^3.12.2",
    "less-loader": "^7.0.1",
    "prettier": "2.1.1",
    "style-loader": "^1.2.1",
    "webpack": "^4.44.1",
    "webpack-cli": "^3.3.12",
    "webpack-dev-server": "^3.11.0"
  }
}

this is my webpack.config.js:

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
    entry: './src/index.js',
    output: {
      // path: __dirname + '/dist',
      path: path.resolve(__dirname, 'build'),
      publicPath: '/',
      filename: 'bundle.js'
    },
    devServer: {
      contentBase: './build'
    },
    module: {
      rules: [
      {
        test: /\.(js|jsx)$/,
        exclude: /node_modules/,
        use: ['babel-loader', 'eslint-loader']
      },
      {
        test: /\.less$/,
        use: [
          'style-loader',
          'css-loader',
          'less-loader',
        ],
      }
      ]
    },
    plugins: [
        new HtmlWebpackPlugin({
          template: path.resolve('./index.html'),
        })],
  };

this is my .eslintrc:

  {
  "parser": "babel-eslint",
  "extends": "react",
  "env": {
    "browser": true,
    "node": true
  },
  "settings": {
    "react": {
      "version": "detect"
    }
  }
}

and this is my .babelrc:

{
    "presets": [
      "@babel/preset-env",
      "@babel/preset-react"
    ],
    "plugins": [
      "@babel/plugin-proposal-class-properties"
    ]
  }

Does anyone have any suggestions? I am wracking my brain trying to figure this out and I am having a lot of trouble. It loads the webpage, however, react isn't utilized at all.

Thank you in advance!! I really appreciate all your help.

over 4 years ago · Santiago Trujillo
16 Respostas
Responde à pergunta

0

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.

over 4 years ago · Santiago Trujillo Relatório

0

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*/**"
],
over 4 years ago · Santiago Trujillo Relatório

0

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
over 4 years ago · Santiago Trujillo Relatório

0

I had this error after a big upgrade of dependencies (react-scripts, react ... ) and the solution was to remove yarn.lock files

over 4 years ago · Santiago Trujillo Relatório

0

I've faced the same error when I was trying to deploy my create-react-app template to Vercel.

  1. Deleting yarn.lock file
  2. (On Vercel Dashboard) Overriding build command from auto to "npm run build"
  3. (On Vercel Dashboard) Overriding install command from auto to "npm install"

helped me to deploy successfully.

over 4 years ago · Santiago Trujillo Relatório

0

If you have eslint in your dependencies, remove that.
The eslint from react-scripts will be used

"eslint": "^7.32.0"
over 4 years ago · Santiago Trujillo Relatório

0

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.

over 4 years ago · Santiago Trujillo Relatório

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"
over 4 years ago · Santiago Trujillo Relatório

0

I have got the same issue.

  • I deleted package-lock.json and node_modules
  • ran 'npm install'

It worked fine.

over 4 years ago · Santiago Trujillo Relatório

0

If you are using Yarn 2(berry)

Add nodeLinker: node-modules in your .yarnrc.yml file

As specified in https://yarnpkg.com/getting-started/install

over 4 years ago · Santiago Trujillo Relatório

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

over 4 years ago · Santiago Trujillo Relatório

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.

over 4 years ago · Santiago Trujillo Relatório

0

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
over 4 years ago · Santiago Trujillo Relatório

0

When I removed

  "extends": [
      "react-app"
    ]
  },

from package.json it worked.

This is because the eslint-config-react-app package is outdated.

over 4 years ago · Santiago Trujillo Relatório

0

even I had this issue, listing down steps to solve this issue.

  1. First remove node modules and install node modules again.
  2. 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
  3. Then I had this issue failed to load config react-app to extend form. I fixed it using

npm add eslint-config-react-app

over 4 years ago · Santiago Trujillo Relatório

0

If you use yarn:

1- Delete: node_modules and yarn.lock
2- Run: yarn install

Note: For npm should be the same approach.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda