visjs / vis-graph3d

📊 Create interactive, animated 3d graphs. Surfaces, lines, dots and block styling out of the box.
https://visjs.github.io/vis-graph3d/
Apache License 2.0
314 stars 44 forks source link

use exactly version 5.0.5 of vis-util #1109

Open Ryan1729 opened 2 months ago

Ryan1729 commented 2 months ago

As mentioned in this comment on #1064, the upstream package vis-util has removed the add/remove event listeners API in https://github.com/visjs/vis-util/pull/1417, in version 5.0.6 specifically.

This causes errors to be displayed in the console when the user lets go of the mouse button after dragging the graph, including in the official examples.

Uncaught TypeError: (void 0) is not a function

This PR changes the package.json to use exactly 5.0.5 of vis-util; the newest version before the removal of the listeners API.

With this change, npm install unfortunately prints this resolution error:

npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: vis-graph3d@0.0.0-no-version
npm error Found: component-emitter@2.0.0
npm error node_modules/component-emitter
npm error   dev component-emitter@"2.0.0" from the root project
npm error
npm error Could not resolve dependency:
npm error peer component-emitter@"^1.3.0" from vis-util@5.0.5
npm error node_modules/vis-util
npm error   dev vis-util@"5.0.5" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.

Running npm install --force overrides this and allows the installation to complete.

After that, doing a build produces a vis-graph3d.min.js file that doesn't produce that Uncaught TypeError anymore.