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.

TypeError: [].values is not a function

See original GitHub issue

When running script via NPM the error TypeError: [].values is not a function is thrown, preventing the obfuscation

Expected Behavior

For the code to be obfuscated and the error to not be thrown or give context as to why it was thrown

Current Behavior

Error is thrown with no explanation why

Steps to Reproduce

Code string is passed to server and processed then returned. Processing always fails. Code string has no obvious issues. `try{ var obfuscationResult = JavaScriptObfuscator.obfuscate( objs.code, { compact: true, simplify: true, stringArray: false,

				}
			);
			responseBody = { 
				status:"success",
				result:obfuscationResult.getObfuscatedCode()
			};
		} catch(e){
			responseBody = { 
				status:"error",
				result:"Could not obsfuctae the given string\n\n"+e.toString()
			};
		}`

Your Environment

package json { "name": "jsobs", "version": "1.0.0", "description": "jsob for packager", "main": "index.js", "dependencies": { "clean-css": "^4.2.4", "css-minifiers": "^3.0.0", "css-minify": "^1.1.0", "html-minifier": "^3.5.21", "http": "0.0.0", "javascript-obfuscator": "^3.2.2" }, "devDependencies": {}, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC" }

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
SimonB2011commented, Feb 8, 2022

Thanks both, it looks like it was down to an older version of node being used. The script executes fine now using v16.13.2

0reactions
SimonB2011commented, Feb 8, 2022

Node version installed on this machine is v10.6.0. I will try updating it and see what happens

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: Object.values is not a function JavaScript
I need to create two arrays. The first array is an array of all the keys from the object. I created this array...
Read more >
TypeError: "x" is not a function - JavaScript - MDN Web Docs
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value...
Read more >
How to Handle JavaScript Uncaught TypeError: “x” is Not a ...
The Javascript error TypeError: "x" is not a function occurs when there is an attempt to call a function on a value or...
Read more >
Error TypeError Object values is not a function - Edureka
I have seen that Object.values() is not supported in all browsers. But I am using the function in Node.js on server side -...
Read more >
TypeError: then is not a function in JavaScript | bobbyhadz
The "then is not a function" error occurs when the then() method is called on a value that is not a promise. To...
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