litegraph.js icon indicating copy to clipboard operation
litegraph.js copied to clipboard

LGraph error when use build mode

Open owyah opened this issue 3 years ago • 3 comments

Problem: When dev mode, all is fine. But if I use build for production mode, this error occurs: TypeError: an.LGraph is not a constructor

Does anyone know about this error?

yarn version 1.10.1 node version v16.13.2 npm version 8.1.2 litegraph.js version 0.7.10 vue version 2.7.7 vite version 3.0.2

Script for dev mode: "dev": "vite --host"

Script for build production mode: "build": "vite build"

owyah avatar Oct 04 '22 00:10 owyah

I am having the same issue. No idea why.

KaruroChori avatar Mar 19 '23 18:03 KaruroChori

it looks like the names are changed when ofuscating the code, and my lib relies in the class names. can you disable that options?

jagenjo avatar Mar 20 '23 09:03 jagenjo

I tired disabling the minify and to force that library to be included, avoiding any potential pruning. Still, I was not successful. The issue is that vite uses different bundling strategies for the dev and build targets. Build mode relies on rollup which does not work with litegraph.js for some reasons.

KaruroChori avatar Mar 30 '23 14:03 KaruroChori