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/
246 stars 123 forks source link

TypeError: O is not a function #15

Open confrodog opened 4 years ago

confrodog commented 4 years ago

i think it might have something to do with the image addition

Screen Shot 2020-06-24 at 3 02 42 PM

I was trying to learn how to use this module by building one attribute at a time, but couldn't even get past the first one

waynedyck commented 3 years ago

Had the same issue and could not resolve it. Ended up deleting the repo.

Zerg00s commented 2 years ago

Same issue here. Was anyone able to resolve it?

ERROR:
O is not a function

CALL STACK:
TypeError: O is not a function
    at SVGImageElement.<anonymous> (https://localhost:4321/dist/program-chart-web-part.js:499:2638)
    at SVGImageElement.attrFunction (https://localhost:4321/dist/program-chart-web-part.js:1383:21)
    at https://localhost:4321/dist/program-chart-web-part.js:1676:16
    at d3_selection_each (https://localhost:4321/dist/program-chart-web-part.js:1682:30)
    at Array../node_modules/d3/d3.js.d3_selectionPrototype.each (https://localhost:4321/dist/program-chart-web-part.js:1675:12)
    at Array../node_modules/d3/d3.js.d3_selectionPrototype.attr (https://localhost:4321/dist/program-chart-web-part.js:1366:17)
    at t.exports (https://localhost:4321/dist/program-chart-web-part.js:499:2582)
    at init (https://localhost:4321/dist/program-chart-web-part.js:433:2875)
    at e.value (https://localhost:4321/dist/program-chart-web-part.js:451:1739)
    at ss (https://res-1.cdn.office.net/files/sp-client/sp-webpart-workbench-assembly_en-us_37194a91081a5a32a8fa7de43d5df223.js:69:89313)
+-- gulp@4.0.2
+-- npm@6.14.16
node.js v14.19.1
waynedyck commented 2 years ago

@Zerg00s not as of today. I would still like to get this working as it is one of the best looking ones I have found.

rastogi-rishabh commented 2 years ago

Try using a class component instead of a functional component

pedrohsmaia commented 1 year ago

anyone managed to solve this?

sarahm16 commented 6 months ago

Thanks @rastogi-rishabh! Using a class component fixed this issue for me :)

waynedyck commented 6 months ago

@sarahm16 do you have a small code sample you code post of how you solved the TypeError?