After running 'npm start' on my localhost, I am getting the following error:
./node_modules/chart.js/dist/chart.js 695:18 Module parse failed: Unexpected token (695:18) File was processed with these loaders:
static defaults = {}; | static datasetElementType = null; | static dataElementType = null;
I have updated versions of chart.js , react chartjs 2. I remove node_modules and package-lock.json and reinstall, the app not started. I've removed node_modules/package-lock.json/clear npm cache. Doesn't help.
For module bundling frameworks often use tools like Webpack or Rollup. Your current version of bundling tool may not support static properties. So you will need to update your webpack version or you may have to use babel/preset-env configuration.
The other solution is to downgrade Chart.js
version. You can go with Chart.js v3.x.x