3.0.0 and above break code that works with 2.13 to 2.19 versions.
Expected Behavior
Upgrading from 2.x to 3.x should "just work" after updating the relevant option names
Current Behavior
3.0.0 and all builds I've tried above that result in: Error: Cannot find module 'yargs-parser'
Steps to Reproduce
- Unknown
Your Environment
- Obfuscator version used: 3.0.0
- Node version used: 16.18.0
Stack trace
at t (/tmp/.mount_AppDsOGW4/resources/app.asar/app/dist/preload.build.js:2:1047713)
at 83356 (/tmp/.mount_AppDsOGW4/resources/app.asar/app/dist/preload.build.js:2:895678)
at u (/tmp/.mount_AppDsOGW4/resources/app.asar/app/dist/preload.build.js:2:1142257)
at 390 (/tmp/.mount_AppDsOGW4/resources/app.asar/app/dist/preload.build.js:2:900842)
at u (/tmp/.mount_AppDsOGW4/resources/app.asar/app/dist/preload.build.js:2:1142257)
at /tmp/.mount_AppDsOGW4/resources/app.asar/app/dist/preload.build.js:2:874357
at u.a (/tmp/.mount_AppDsOGW4/resources/app.asar/app/dist/preload.build.js:2:1142784)
at 93607 (/tmp/.mount_AppDsOGW4/resources/app.asar/app/dist/preload.build.js:2:874207)
at u (/tmp/.mount_AppDsOGW4/resources/app.asar/app/dist/preload.build.js:2:1142257)
at /tmp/.mount_AppDsOGW4/resources/app.asar/app/dist/preload.build.js:2:1144138
Minimal working example that will help to reproduce issue
Apparently merely importing yargs-parser, though I am not yet certain.
Additional notes
We're applying the obfuscation using webpack-obfuscator rather than calling javascript-obfuscator directly. I tested versions 4, 3, and 2.13 to 2.19. The 2.x versions work, but nothing above.
Is the yargs-parser module being bundled into your preload.build.js?
Yes it is (and previously worked fine with the same yargs-parser version.)
Possibly a duplicate of (https://github.com/javascript-obfuscator/javascript-obfuscator/issues/1093). See this comment: https://github.com/javascript-obfuscator/javascript-obfuscator/issues/1093#issuecomment-1613908105