FlowingCode / OrgChartAddon

Organizational Chart Vaadin Add-on
https://www.flowingcode.com/en/open-source/
Apache License 2.0
18 stars 4 forks source link

JSONDigger is not defined #79

Open javier-godoy opened 2 months ago

javier-godoy commented 2 months ago

Describe the bug

fc-orgchart-styles-DN-_P1bn.js:16 Uncaught (in promise) ReferenceError: JSONDigger is not defined
    at B.dropHandler (fc-orgchart-styles-DN-_P1bn.js:16:40109)
    at HTMLDivElement.dispatch (fc-orgchart-styles-DN-_P1bn.js:13:43325)
    at J.handle (fc-orgchart-styles-DN-_P1bn.js:13:41294)

Expected behavior

No response

Minimal reproducible example

  1. Go to https://addonsv24.flowingcode.com/orgchart/drag-and-drop
  2. Attempt to drag an item
  3. Observe that an error is logged in the browser console

Add-on Version

5.0.1

Vaadin Version

24.4.1

Additional information

No response

paodb commented 2 months ago

JSONDigger is a dependency that was added in the base library since version 3.4.0. I tried to add this dependency in the add-on using @NpmPackage(value = "json-digger", version = "2.0.2") and @JsModule("json-digger/dist/json-digger.js") but that's not enough as the import of JSONDigger object is missing in the core component. Tried adding it in the fc-orgchart.js file but a lot of webpack errors appears when trying to run the demo app in vaadin 14, like image If I run profile v24 then I get a different error image

One other aproach I tried was to donwgrade the library dependency to one that is not using JsonDigger, like 3.2.0, It works but some styling break on the drag/drog example that would need fixing.