unicef / react-org-chart

Component for displaying an org chart for a large organization. Supports lazy load and export.
https://unicef.github.io/react-org-chart/
241 stars 122 forks source link

Can't resolve d3 package #18

Open L-van-der-merwe opened 4 years ago

L-van-der-merwe commented 4 years ago

Hi,

I added the package to my project and it resolved into this issue.

ERROR in ./node_modules/@unicef/react-org-chart/dist/index.js Module not found: Error: Can't resolve 'd3' in '\web\node_modules\@unicef\react-org-chart\dist' @ ./node_modules/@unicef/react-org-chart/dist/index.js 7:94-107 @ ./src/features/membership/ui/views/HierarchyView.jsx @ ./src/features/membership/ui/views/index.js @ ./src/features/membership/ui/MembershipPage.jsx @ ./src/features/membership/ui/index.js @ ./src/features/membership/index.js @ ./src/features/index.js @ ./src/index.js @ multi (webpack)-dev-server/client?http://localhost:5000 (webpack)/hot/dev-server.js ./node_modules/@neutrinojs/react/node_modules/react-hot-loader/patch.js ./src/index

Any solution in fixing this issue so that I can make use of this awesome component?

itsnotme01 commented 4 years ago

Hello @LeanSaucecode, For fixing this issue I installed d3 in my project root folder.

Edit: You need to install the 3.5.17 version of d3 for avoiding issues: https://github.com/unicef/react-org-chart/issues/13

Edit 2: If you don't have any error and nothing is displayed try this: https://github.com/unicef/react-org-chart/issues/17#issuecomment-675554060