I am using Nuxt 2 with Vue version 2.15.3 and my Node version is 18.18.0, npm 9.8.1
"nuxt": "^2.15.3",
"d3-org-chart": "^3.1.1",
After npm install d3-org-chart
, when import {OrgChart} from 'd3-org-chart';
I get following error:
Error require() of ES Module /node_modules/d3-selection/src/index.js from /node_modules/d3-org-chart/build/d3-org-chart.min.js not supported. Instead change the require of index.js in /node_modules/d3-org-chart/build/d3-org-chart.min.js to a dynamic import() which is available in all CommonJS modules.
I tried npm install --save-dev @types/d3-org-chart
, that did not help. Same error.