title: React - Module parse failed: Unexpected Token. You may need an appropriate loader to handle this file type
body: <p>My first time using react, so apologies if I'm doing something obvious and incredibly wrong.  That said, I've read up on several similar-seeming bugs on here and on github and I can't find anything that works for mine.  Here's the full error message:</p>
  <pre><code>ERROR in ./src/frontend/src/components/App.js 6:15
  Module parse failed: Unexpected token (6:15)
  You may need an appropriate loader to handle this file type.
  | class App extends Component{
  |     render() {
  &gt;         return &lt;h1&gt;React App&lt;/h1&gt;
  |     }
  | }
   @ ./src/frontend/src/index.js 1:0-35
  
  </code></pre>
  <p>The full code from which that error message was drawn:</p>
  <pre><code>import React, { Component } from 'react';
  import ReactDOM from 'react-dom';
  
  class App extends Component{
      render() {
          return &lt;h1&gt;React App&lt;/h1&gt;
      }
  }
  
  ReactDOM.render(&lt;App /&gt;, document.getElementById('app'));
  </code></pre>
  <p>I feel like something is wrong with my webpack-config.js, but I copied that directly from a tutorial I was using so I'm not sure why it would be wrong.  Here it is, for reference:</p>
  <pre><code>module.exports = {
    module: {
      rules: [
        {
          test: /\.js$/,
          exclude: /node_modules/,
          use: {
            loader: &quot;babel-loader&quot;
          }
        }
      ]
    }
  }
  </code></pre>
  <p>And here are my package dependencies from package.json:</p>
  <pre><code>&quot;dependencies&quot;: {
      &quot;prop-types&quot;: &quot;^15.7.2&quot;,
      &quot;react&quot;: &quot;^16.13.1&quot;,
      &quot;react-dom&quot;: &quot;^16.13.1&quot;
    },
  </code></pre>
  <p>And finally my .babelrc</p>
  <pre><code>{
      &quot;presets&quot;: [&quot;@babel/preset-env&quot;,&quot;@babel/preset-react&quot;],
      &quot;plugins&quot;: [&quot;transform-class-properties&quot;.js]
  }
  </code></pre>
  <p>I really have no idea what's going on, so any help would be much appreciated.  Please let me know if I left out any relevant info that could be helpful.  Thank you.</p>