-
-
Notifications
You must be signed in to change notification settings - Fork 384
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
Confetti doesn't work after obfuscation. #166
Comments
@catdad Could you please help with this? "javascript-obfuscator": "^2.11.0" used |
Hmm... what have you done to investigate so far? I assume you have reason to believe this is an issue with this library and not an issue with the obfuscator? |
@catdad just high level investigation. Also it is worth mentioned I'm using your wonderful library inside angular-electron app(so all kinds of angular minifications/optimizations are happening). It happens after obfuscation only(so my CI steps: build(works here)> obfuscate(errors here)) |
I think this may be due to the main function being obfuscated, the code injected may not be able to run in a worker env. Not exactly sure why (like a transpiled function not available?) https://github.com/catdad/canvas-confetti/blob/master/src/confetti.js#L133 |
I have the same problem... |
same here :( |
I've also run across an issue where bundling this library produces an invalid main file, I believe the core issue here is that bundlers don't garantee that all code required for the library will remain inside of the main function, I've set up a minimal example here that shows this using esbuild with in the output shown you can see that esbuild has injected a helper function for defining function names at the top of the file outside of the main function we provided it. the only clear solution I can see to this is to provide a pre stringified version of the library or perhaps have a bundler friendly export that re-imports a copy as a worker (though this may not be safe across all bundlers) |
The text was updated successfully, but these errors were encountered: