Version: 4.0.0. Error: Evaluation failed: ReferenceError: _0x5b9d0e is not defined with config stringArray: true
javascript-obfuscator version: 4.0.0
stringArray: true will cause this error, UnhandledPromiseRejectionWarning: Error: Evaluation failed: ReferenceError: _0xa28d is not defined
config:
{
"compact": true,
}
run code sussessed after added stringArray: false to config.
Code:
const puppeteer = require('puppeteer-core');
let params = {
ignoreHTTPSErrors: true,
args: [
'--ignore-certificate-errors',
'--no-sandbox',
],
executablePath: this.chromePath,
headless: true,
};
const browser = await puppeteer.launch(params);
var page = await browser.newPage();
await page.goto(this.url, { waitUntil: 'load' });
await page.content(); ----------------------- error in this line
await page.setViewport({ width: 1600, height: 1200 });
await page.waitForTimeout(2000);
Error info:
(node:22648) UnhandledPromiseRejectionWarning: Error: Evaluation failed: ReferenceError: _0xa28d is not defined
at __puppeteer_evaluation_script__:1:21
at _0x1ce9f4._evaluateInternal (E:\xx\dist\bundle.js:1:3355462)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async _0x1ce9f4.evaluate (E:\xx\dist\bundle.js:1:3353310)
at async _0x23b99f.content (E:\xx\dist\bundle.js:1:3400665)
at async _0x14d154.content (E:\xx\dist\bundle.js:1:3508435)
at async _0x571581.getContentInaSinglePage (E:\xx\dist\bundle.js:1:4423286)
at async _0x508402.isInteresting (E:\xx\dist\bundle.js:1:4622902)
at async _0x508402.startScan (E:\xx\dist\bundle.js:1:4641280)
at async _0x421a37.scan (E:\xx\dist\bundle.js:1:4643371)
at async E:\xx\dist\bundle.js:1:4970734
I'm not sure if it's something I'm using wrong or a BUG.
I am getting a similar problem randomly (not always) and at different points of code while using gulp-javascript-obfuscator to prepare our code.
I am using the following in gulpfile.js
const javascriptObfuscator = require('gulp-javascript-obfuscator');
gulp.src(['app/scripts/**/*.js']) .pipe(javascriptObfuscator({ compact: true }));
A few points to notice are...
- It breaks the code sometimes, not always.
- It is not breaking the same file/or piece of code, rather it breaks on file or other dynamically.
- If I prepare the code again then it works.
- I never noticed it breaking on my Mac, but on the CentOS server, we face this issue very often.
The error looks like below (One example):
Uncaught TypeError: Cannot read properties of undefined (reading '12') at _0x13b6 (utility.js:1:49938) at _0x13b6 (utility.js:1:49969) at utility.js:1:70153 at dispatch (jquery.js:4435:9) at jquery.js:4121:28
Any suggestions/help will be appreciated.
Have you found any fix for this? I am having this same issue.
I switched from
gulp-javascript-obfuscator
javascript-obfuscator
to other obfuscation module
gulp-js-obfuscator
js-obfuscator
and no issues so far.
.
I am having this same issue. on the CentOS server ,sometimes some js files => Cannot read properties of undefined
I really need a fix for this. Any more news?
Hi. Right now i dont't have time to work on this project. But PR welcomed (with tests, etc)
I haven't try js-obfuscator, but looks like it will upload the code to the cloud
no update, I'm still using stringArray: false 😟 ,and expecting a helpful reply.
i has the same problem,in 4.0.0version javascript-obfuscator
ReferenceError: hz_904_0x57ff is not defined
I switched from
gulp-javascript-obfuscator javascript-obfuscator
to other obfuscation module
gulp-js-obfuscator js-obfuscator
and no issues so far.
.
I can confirm after using the other module for over a month that I never encountered that issue in this package.
I ran into the same issue. It turned out that the reason was that options.identifiersPrefix needs a different value for each file you are obfuscating.
Also see here: https://github.com/javascript-obfuscator/javascript-obfuscator/issues/568
In my case it was the https://github.com/javascript-obfuscator/grunt-contrib-obfuscator Grunt plugin which didn't properly generate those prefixes, I created a PR there (https://github.com/javascript-obfuscator/grunt-contrib-obfuscator/pull/41) but also a new Grunt plugin (npmjs.com/package/grunt-contrib-obfuscator-4 )