jagenjo / litegraph.js

A graph node engine and editor written in Javascript similar to PD or UDK Blueprints, comes with its own editor in HTML5 Canvas2D. The engine can run client side or server side using Node. It allows to export graphs as JSONs to be included in applications independently.
MIT License
5.32k stars 602 forks source link

The method mounted on global in the ES Modules environment throws an error #461

Open WoJiaoFuXiaoYun opened 1 month ago

WoJiaoFuXiaoYun commented 1 month ago

When I import litegraph.js in vite and encounter an error, I traced the code and found that the methods are mounted through global, while in the vite development environment, they are loaded using EMS.I think it should be this problem.

litegraph.js:16882  Uncaught ReferenceError: clamp is not defined
    at WidgetNumber.onMouseUp (litegraph.js:16882:12)
    at LGraphCanvas.processMouseUp (litegraph.js:6910:26)