Closed FilippoPolo closed 5 years ago
@cjmyers Just for some additional context. We are facing this issue only when visbol-js is minified. When we use it normally, we don't encounter this issue.
To recreate this issue (at-least based on how we encounter it), if you minify visbol-js using uglify-js you should encounter this issue. Please let us know if you require any additional details to recreate this error.
Hmm, this one is really outside my wheelhouse. @udp @3ach do either of you have any thoughts?
@udp @3ach James/Zach: do either of you have any thoughts on this?
Would it be possible to send your minified svg.js? I tried running uglifyjs on svg.js alone, and CustomEvent is still CustomEvent.
I believe it only happens if you bundle first, i.e. with webpack. It looks like some kind of bad interaction with the module system.
We couldn't figure this out, but it turns out the issue is no longer present in the most recent version of Visbol. We're just going to use that.
That's good.
Hi all,
We're using visbol-js as part of a compbio tool, and we have problems when attempting to bundle it for production. We are using webpack with a standard production configuration, which includes minification through uglifyjs.
After minification, the function named "fire" in svg.js no longer works. The error we see in the browser console is as follows: TypeError: "e is not a constructor"
In this case, that 'e' is actually the constructor for CustomEvent, which the minifier is supposed to have shortened. In debug, "new CustomEvent" works normally; in production, "new e" fails with the error above.
I've tried upgrading webpack and uglifyjs to the latest versions, but the problem persists.