Error when obfuscating TypeScript with deadCodeInjection: true
See original GitHub issueUsing webpack-obfuscator 0.10.1 (also with 0.10.0), I receive the following error when running webpack -p
. It only occurs when deadCodeInjection is turned on and happens at any deadCodeInjectionThreshold. I’m not sure if it’s my specific setup or an issue with javascript/webpack-obfuscator.
./node_modules/javascript-obfuscator/dist/webpack:/src/node/NodeUtils.ts:52
.keys(node)
^
TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at e (./node_modules/javascript-obfuscator/dist/webpack:/src/node/NodeUtils.ts:52:22)
at Array.map (native)
at ./node_modules/javascript-obfuscator/dist/webpack:/src/node/NodeUtils.ts:62:48
at Array.forEach (native)
at e (./node_modules/javascript-obfuscator/dist/webpack:/src/node/NodeUtils.ts:54:25)
at Array.map (native)
at ./node_modules/javascript-obfuscator/dist/webpack:/src/node/NodeUtils.ts:62:48
at Array.forEach (native)
at e (./node_modules/javascript-obfuscator/dist/webpack:/src/node/NodeUtils.ts:54:25)
at ./node_modules/javascript-obfuscator/dist/webpack:/src/node/NodeUtils.ts:64:53
at Array.forEach (native)
at e (./node_modules/javascript-obfuscator/dist/webpack:/src/node/NodeUtils.ts:54:25)
at Array.map (native)
at ./node_modules/javascript-obfuscator/dist/webpack:/src/node/NodeUtils.ts:62:48
at Array.forEach (native)
at e (./node_modules/javascript-obfuscator/dist/webpack:/src/node/NodeUtils.ts:54:25)
at Array.map (native)
at ./node_modules/javascript-obfuscator/dist/webpack:/src/node/NodeUtils.ts:62:48
at Array.forEach (native)
at e (./node_modules/javascript-obfuscator/dist/webpack:/src/node/NodeUtils.ts:54:25)
at Array.map (native)
at ./node_modules/javascript-obfuscator/dist/webpack:/src/node/NodeUtils.ts:62:48
at Array.forEach (native)
at e (./node_modules/javascript-obfuscator/dist/webpack:/src/node/NodeUtils.ts:54:25)
at ./node_modules/javascript-obfuscator/dist/webpack:/src/node/NodeUtils.ts:64:53
at Array.forEach (native)
at e (./node_modules/javascript-obfuscator/dist/webpack:/src/node/NodeUtils.ts:54:25)
at Array.map (native)
at ./node_modules/javascript-obfuscator/dist/webpack:/src/node/NodeUtils.ts:62:48
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
react-native-obfuscating-transformer is not obfuscating any code
I am looking to enable react-native-obfuscating-transformer but can't ... compact: true, controlFlowFlattening: false, deadCodeInjection: ...
Read more >javascript-obfuscator - npm
deadCodeInjection. Type: boolean Default: false. ⚠️ Dramatically increases size of obfuscated code (up to 200%) ...
Read more >JavaScript Obfuscator Tool
JavaScript Obfuscator is a free online tool that obfuscates your source code, preventing it from being stolen and used without permission.
Read more >Top 5 javascript-obfuscator Code Examples - Snyk
obfuscate ('var foo = 1;', { compact: true, debugProtection: false, debugProtectionInterval: false, disableConsoleOutput: true, encodeUnicodeLiterals: false, ...
Read more >Obfuscating JavaScript code with Node.js - DEV Community
Thankfully, there is a common practice called code obfuscation that ... { compact: true, controlFlowFlattening: false, deadCodeInjection: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sanex3339 I tested it out and the error no longer occurs during webpack compilation. The generated JavaScript appears to run without any visible issues in Chrome. Thank you! 👏👏👏
You’re welcome.