question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when obfuscating TypeScript with deadCodeInjection: true

See original GitHub issue

Using 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:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
msheakoskicommented, Aug 2, 2017

@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! 👏👏👏

0reactions
sanex3339commented, Aug 2, 2017

You’re welcome.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found