Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSONDigger is not defined #79

Open
javier-godoy opened this issue Jun 27, 2024 · 3 comments
Open

JSONDigger is not defined #79

javier-godoy opened this issue Jun 27, 2024 · 3 comments
Assignees

Comments

@javier-godoy
Copy link
Member

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

@github-project-automation github-project-automation bot moved this to Inbox (needs triage) in Flowing Code Addons Jun 27, 2024
@paodb paodb self-assigned this Jul 2, 2024
@paodb paodb moved this from Inbox (needs triage) to To Do in Flowing Code Addons Jul 2, 2024
@paodb
Copy link
Member

paodb commented Jul 8, 2024

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.

@paodb
Copy link
Member

paodb commented Sep 11, 2024

Found this related issue on the original library.

@jxmai
Copy link

jxmai commented Oct 1, 2024

@paodb It seems we're facing a similar issue due to an upstream dependency. The JSON Digger library was added as a required dependency, but it brought in webpack-related dependencies along with it.

You can see the source here: https://raw.githubusercontent.com/dabeng/json-digger/refs/heads/master/dist/json-digger.js (The JS file is quite large 😅).

Not sure if your situation is better, but for us, we're not using webpack at all, and this has become a blocker for upgrading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To Do
Development

No branches or pull requests

3 participants