experience-experiments / react-easy-chart

[DEPRECATED] - Easy to use React Charting library
http://experience-experiments.github.io/react-easy-chart
BSD 3-Clause "New" or "Revised" License
142 stars 55 forks source link

Problems with Babel 7.2 - Module not found: Can't resolve.... #149

Open enriquin opened 5 years ago

enriquin commented 5 years ago

Hello

After upgrading my project to WebPack4 + Babel 7.2 I get lots of errors regarding babel plugins:

ERROR in ./node_modules/react-easy-chart/lib/area-chart/index.js Module not found: Error: Can't resolve 'babel-runtime/core-js/object/get-prototype-of' in 'D:\I_School\ISchool\ISchool.WebBackend\ClientApp\node_modules\react-easy-chart\lib\area-chart' @ ./node_modules/react-easy-chart/lib/area-chart/index.js 7:22-78 @ ./node_modules/react-easy-chart/lib/index.js @ ./src/components/accounting/dashboards/Forecast.tsx @ ./src/components/accounting/dashboards/Index.tsx @ ./src/components/accounting/AccountingRoutes.tsx @ ./src/routes.tsx @ ./src/boot.tsx @ multi ./src/boot.tsx
and ERROR in ./node_modules/react-easy-chart/lib/area-chart/index.js Module not found: Error: Can't resolve 'babel-runtime/helpers/createClass' in 'D:\I_School\ISchool\ISchool.WebBackend\ClientApp\node_modules\react-easy-chart\lib\area-chart' @ ./node_modules/react-easy-chart/lib/area-chart/index.js 19:20-64 @ ./node_modules/react-easy-chart/lib/index.js @ ./src/components/accounting/dashboards/Forecast.tsx @ ./src/components/accounting/dashboards/Index.tsx @ ./src/components/accounting/AccountingRoutes.tsx @ ./src/routes.tsx @ ./src/boot.tsx @ multi ./src/boot.tsx

It seems that it is looking for modules that are no longer there, for example "getPrototypeOf" and "createClass" are now in "node_modules\@babel\runtime\helpers\esm" not in the path it is looking for,

The babel package versions I'm using are: "@babel/cli": "7.2.3", "@babel/core": "7.2.2", "@babel/plugin-proposal-class-properties": "7.2.3", "@babel/plugin-proposal-object-rest-spread": "7.2.0", "@babel/preset-env": "7.2.3", "@babel/preset-react": "7.0.0", "@babel/preset-typescript": "7.1.0", "@babel/runtime": "7.2.0",

Note: as seen here https://github.com/creativetimofficial/ct-material-dashboard-pro-react/issues/62 it seems that there is a breaking change in Babel 7. Any idea in how to fix that?

Thanks!

ghost commented 5 years ago

Same problem as you --

../node_modules/react-easy-chart/lib/area-chart/index.js
[1] Module not found: Can't resolve 'babel-runtime/core-js/object/get-prototype-of' in '/Users/syd/Documents/github/mnist/node_modules/react-easy-chart/lib/area-chart'

Would love to see this resolved