title: React build error: Module build failed (from ./node_modules/babel-loader/lib/index.js):
body: <p>I am following along with a tutorial and when I try to build react I get an error.</p>
  
  <pre><code>Module build failed (from ./node_modules/babel-loader/lib/index.js)
    5 | ReactDOM.render(
  &gt; 6 |     &lt;App /&gt;,
      |     ^
    7 |     document.getElementById('root')
    8 | );
  </code></pre>
  
  <p>I found similar issues and I tried to fix the issue based on this but to no avail.
  This is my webpack.config.js:</p>
  
  <pre><code>module.exports = {
      entry: './index.js',
      output:{
          path: __dirname,
          filename: 'bundle.js'
      },
      module:{
          rules:[
              {
                  test: /\.jsx?$/,
                  loader: 'babel-loader',
                  exclude: '/node_modules/'
              }
          ]
      }
  }
  </code></pre>
  
  <p>Below I have package.json, the <code>"devDependencies"</code> are what I have found in previous solutions.</p>
  
  <pre><code>{
    "name": "rtsupport",
    "version": "1.0.0",
    "description": "Realtime support frontend",
    "main": "./index.js",
    "scripts": {
      "test": "echo \"Error: no test specified\" &amp;&amp; exit 1",
      "develop": "webpack --mode development --watch",
      "build": "webpack --mode development"
    },
    "author": "",
    "license": "ISC",
    "dependencies": {
      "node": "^10.15.2",
      "react-dom": "^16.8.4"
    },
    "devDependencies": {
      "@babel/core": "^7.0.0-bridge.0",
      "babel": "^5.8.23",
      "babel-core": "^6.26.3",
      "babel-loader": "^7.1.5",
      "react": "^16.8.4",
      "webpack": "^4.29.6",
      "webpack-cli": "^3.2.3"
    }
  }
  </code></pre>
  
  <p>These are my initial <code>"devDependencies"</code></p>
  
  <pre><code> "devDependencies": {
      "@babel/core": "^7.3.4",
      "babel": "^5.8.23",
      "babel-core": "^6.26.3",
      "babel-loader": "^8.0.5"
    }
  </code></pre>
  
  <p>My Node version is: v11.10.1</p>
  
  <p>After trying the suggestions with:</p>
  
  <pre><code>rules:[
              {
                  test: /\.(js|jsx)$/,
                  exclude: '/node_modules/',
                  use: [
                      { loader: 'babel-loader' }
                    ]
              }
          ]
  </code></pre>
  
  <p>I still get the same error.</p>