In a Remix app, I can't use React Charts any more :-(
If I try the 3.0 beta the build fails with:
Error [ERR_REQUIRE_ESM]: require() of ES Module /node_modules/d3-time-format/src/index.js from /node_modules/react-charts/lib/utils/buildAxis.linear.js not supported.
[1] Instead change the require of index.js in /node_modules/react-charts/lib/utils/buildAxis.linear.js to a dynamic import() which is available in all CommonJS modules.
While if I try the 2.0 beta-7 the build fails with:
1] ✘ [ERROR] Could not resolve "performance-now"
[1]
[1] node_modules/react-charts/dist/react-charts.development.js:853:20:
[1] 853 │ var now = require('performance-now'),
[1] ╵ ~~~~~~~~~~~~~~~~~
Can anyone suggest a workaround? I'm loath to use another charting library, I like React Charts.
Reproduction here: https://github.com/fergusmeiklejohn/rc-esm-bug-demo
npm inpm run devnavigate to locahost:3000 error logs in server console