title: Chart.js Error: You may need an appropriate loader to handle this file type
body: <p>I'm currently attempting to use <code>Chart.js</code> within my react application but when I go to build my application I'm presented with this error</p>
  <pre><code>ERROR in ./node_modules/chart.js/dist/chart.esm.js
  Module parse failed: D:\MyApp\node_modules\chart.js\dist\chart.esm.js Unexpected token (6613:12)
  You may need an appropriate loader to handle this file type.
  |         if (intermediateIndex1 !== startIndex &amp;&amp; intermediateIndex1 !== lastIndex) {
  |           decimated.push({
  |             ...data[intermediateIndex1],
  |             x: avgX,
  |           });
   @ ./src/imports/Dashboard/Dashboard.js 21:12-31
   @ ./src/App.js
   @ ./src/index.js
   @ multi babel-polyfill ./src/index.js
  
  </code></pre>
  <p>I tried researching online to see if anyone else has had the same issue, but I had no luck.</p>
  <p>Below is my Webpack config file:</p>
  <pre><code>const path = require('path');
  
  module.exports = {
      entry: ['babel-polyfill', './src/index.js'],
    output: {
      path: path.join(__dirname, 'public'),
      filename: 'bundle.js'
    },
    module: {
      rules: [{
        loader: 'babel-loader',
        test: /\.jsx?$/,
        exclude: /node_modules/
      }, {
        test: /\.s?css$/,
        use: [
          'style-loader',
          'css-loader',
          'sass-loader'
        ]
      },{
          test: /\.(jpe?g|png|gif|svg|mp3)$/i,
          loaders: [
              'file-loader?hash=sha512&amp;digest=hex&amp;name=[hash].[ext]',
              'image-webpack-loader?bypassOnDebug&amp;optimizationLevel=7&amp;interlaced=false'
          ]
      }
      ]
    },
    devtool: 'cheap-module-eval-source-map',
    devServer: {
      contentBase: path.join(__dirname, 'public'),
      historyApiFallback: true
    }
  };
  </code></pre>
  <p>And here is my bablerc file</p>
  <pre><code>{
      &quot;presets&quot;: [
        &quot;env&quot;,
        &quot;react&quot;,
        &quot;stage-0&quot;
      ],
      &quot;plugins&quot;: [
        &quot;transform-class-properties&quot;
      ]
    }
  
  </code></pre>
  <p>This is the list of my dependencies that are installed</p>
  <pre><code>&quot;dependencies&quot;: {
      &quot;@babel/polyfill&quot;: &quot;^7.0.0&quot;,
      &quot;aws-sdk&quot;: &quot;^2.580.0&quot;,
      &quot;axios&quot;: &quot;^0.19.0&quot;,
      &quot;babel-cli&quot;: &quot;^6.26.0&quot;,
      &quot;babel-core&quot;: &quot;^6.26.3&quot;,
      &quot;babel-loader&quot;: &quot;7.1.1&quot;,
      &quot;babel-plugin-transform-class-properties&quot;: &quot;6.24.1&quot;,
      &quot;babel-polyfill&quot;: &quot;^6.26.0&quot;,
      &quot;babel-preset-env&quot;: &quot;^1.7.0&quot;,
      &quot;babel-preset-react&quot;: &quot;6.24.1&quot;,
      &quot;babel-preset-stage-0&quot;: &quot;^6.24.1&quot;,
      &quot;bcryptjs&quot;: &quot;^2.4.3&quot;,
      &quot;body-parser&quot;: &quot;^1.18.2&quot;,
      &quot;chart.js&quot;: &quot;^3.1.0&quot;,
      &quot;core-js&quot;: &quot;^2.5.3&quot;,
      &quot;css-loader&quot;: &quot;0.28.4&quot;,
      &quot;express&quot;: &quot;latest&quot;,
      &quot;file-loader&quot;: &quot;^1.1.5&quot;,
      &quot;google-maps-react&quot;: &quot;^2.0.2&quot;,
      &quot;image-webpack-loader&quot;: &quot;^3.4.2&quot;,
      &quot;immutability-helper&quot;: &quot;^2.4.0&quot;,
      &quot;jquery&quot;: &quot;^3.4.1&quot;,
      &quot;jsbarcode&quot;: &quot;^3.11.0&quot;,
      &quot;jsonwebtoken&quot;: &quot;^8.1.0&quot;,
      &quot;lodash&quot;: &quot;^4.17.14&quot;,
      &quot;moment&quot;: &quot;^2.22.2&quot;,
      &quot;node-sass&quot;: &quot;^4.12.0&quot;,
      &quot;node-schedule&quot;: &quot;^1.3.2&quot;,
      &quot;nodemailer&quot;: &quot;^4.7.0&quot;,
      &quot;normalize.css&quot;: &quot;7.0.0&quot;,
      &quot;npm&quot;: &quot;^6.10.0&quot;,
      &quot;papaparse&quot;: &quot;^5.1.1&quot;,
      &quot;promise-mysql&quot;: &quot;^3.1.0&quot;,
      &quot;prop-types&quot;: &quot;^15.6.0&quot;,
      &quot;react&quot;: &quot;^16.0.0&quot;,
      &quot;react-csv&quot;: &quot;^1.0.14&quot;,
      &quot;react-dom&quot;: &quot;^16.0.0&quot;,
      &quot;react-router-dom&quot;: &quot;4.2.2&quot;,
      &quot;react-scripts&quot;: &quot;1.0.14&quot;,
      &quot;sass-loader&quot;: &quot;6.0.6&quot;,
      &quot;socket.io&quot;: &quot;^2.0.3&quot;,
      &quot;style-loader&quot;: &quot;0.18.2&quot;,
      &quot;twilio&quot;: &quot;^3.24.0&quot;,
      &quot;validator&quot;: &quot;8.0.0&quot;,
      &quot;webpack&quot;: &quot;3.1.0&quot;,
      &quot;webpack-dev-server&quot;: &quot;2.5.1&quot;
    },
  </code></pre>
  <p>I expected the error to tell me what loader I needed to install to use with <code>Chart.js</code> but it does not specify.  If anyone knows which loader I need to install and where I should put it in my files that would be awesome. TIA!</p>