Accepted answer

The error you are getting is because you are trying to use a Babel 6 preset on Babel 7.

"@babel/preset-env", "@babel/preset-react","es2015", "react", "stage-1"

is not quite right.

  • "es2015" was replaced by "@babel/preset-env"
  • "react" was replaced by "@babel/preset-react"
  • "stage-1" does not exist for Babel 7 and you should use the individual plugins that you actually want to enable.

Change your config to

"presets": [
  "@babel/preset-env", "@babel/preset-react"

and then add more plugins if there are other things that give you errors when you compile.


I think you should try the following

npm uninstall --save babel-loader
npm uninstall --save @babel/core
npm install --save-dev babel-loader@^7

That worked for me.

Also have a look at your dependencies, you are having some duplicates that could lead you to errors at some moment.

Related Query

More Query from same tag