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.

Version: 4.0.0. Error: Evaluation failed: ReferenceError: _0x5b9d0e is not defined with config stringArray: true

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
satinder1208commented, Jun 19, 2022

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…

  1. It breaks the code sometimes, not always.
  2. It is not breaking the same file/or piece of code, rather it breaks on file or other dynamically.
  3. If I prepare the code again then it works.
  4. 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.

0reactions
satinder1208commented, Jul 26, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

async function inside evaluate fails · Issue #1665 - GitHub
Code await page.evaluate(async () => { console.log('1') }) Error ... Error: Evaluation failed: ReferenceError: fn is not defined at ...
Read more >
Evaluation failed: ReferenceError: _0x5b9d0e is not defined ...
I can successfully run the code below, But failed after obfuscating with javascript-obfuscator .
Read more >
Puppeteer Evaluation failed: ReferenceError: __awaiter is ...
I am using Puppeteer with TypeScript and when I try to evaluate an async function on a page: await page.evaluate(async function() { //...
Read more >
Evaluation failed: ReferenceError: req is not defined". Im using ...
I get the error "Error: Evaluation failed: ReferenceError: req is not defined". Im using puppeteer and im trying to get the clients input...
Read more >
Reviewing Build 3 • Tiro-health/medical-forms - Chromatic
Error stack trace View in Storybook. Error: Evaluation failed: ReferenceError: React is not defined at DropdownMultipleCombobox ...
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