Accepted answer

The error comes from this line: return <h1>React App</h1>, because <h1>...</h1> is not valid javascript. Even if rename this is would be parsed as vanilla js and not jsx, because of your webpack-config.js, so there are multiple things you should do to fix it:

  1. Rename App.js to App.jsx,
  2. Update test: /\.js$/, to test: /\.(js|jsx)$/, in webpack-config.js
  3. I think there is also an error in your .babelrc: you don't want that .js there, after "transform-class-properties".
  4. Rename webpack-config.js to webpack.config.js

Here is a tutorial that shows this: Also, you could use that simplifies all of this and provides a great starting config.

Related Query

More Query from same tag