palerdot / react-d3-speedometer

React Speedometer component using d3.js ⚛️
https://palerdot.in/react-d3-speedometer/
MIT License
230 stars 57 forks source link

"Error: require() of ES Module" while unit testing with vitest and react-resting library #156

Open ganesh31 opened 1 year ago

ganesh31 commented 1 year ago

Getting the below error when rendering the speedometer component during unit testing

Error: require() of ES Module /node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isNumber.js from /node_modules/.pnpm/react-d3-speedometer@1.1.0_biqbaboplfbrettd7655fr4n2y/node_modules/react-d3-speedometer/dist/core/util/index.js not supported. Instead change the require of isNumber.js in /node_modules/.pnpm/react-d3-speedometer@1.1.0_biqbaboplfbrettd7655fr4n2y/node_modules/react-d3-speedometer/dist/core/util/index.js to a dynamic import() which is available in all CommonJS modules. Serialized Error: { "code": "ERR_REQUIRE_ESM", }