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.

Uncaught RangeError: Maximum call stack size exceeded

See original GitHub issue

Hi, I’m developing a desktop app with Electron + React and I want to obfuscate my code. I’m facing an issue when I add a JavaScriptObfuscator on my plugins queue: on the served html page I have an error saying

main.js:1 Uncaught RangeError: Maximum call stack size exceeded

This happens independently from the obfuscator options except for empty options. The one I’m trying right now is the following (which should be the “Low obfuscation, High performance”) :

new JavaScriptObfuscator ({
    compact: false,
    controlFlowFlattening: false,
    deadCodeInjection: false,
    debugProtection: false,
    debugProtectionInterval: false,
    disableConsoleOutput: true,
    identifierNamesGenerator: 'hexadecimal',
    log: false,
    renameGlobals: false,
    rotateStringArray: true,
    selfDefending: true,
    stringArray: true,
    stringArrayEncoding: false,
    stringArrayThreshold: 0.75,
    unicodeEscapeSequence: false
}, [])

To be more clear here is my webpack.config.js (I use Webpack 4.1.1):

const HtmlWebPackPlugin = require("html-webpack-plugin");
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const JavaScriptObfuscator = require('webpack-obfuscator');
const path = require('path');

module.exports = {
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: {
          loader: "babel-loader"
        }
      },
      {
        test: /\.html$/,
        use: [
          {
            loader: "html-loader",
            options: { minimize: true }
          }
        ]
      },

      {
        test: /\.css$/,
            loader: 'style-loader!css-loader?modules=true&localIdentName=[name]__[local]___[hash:base64:5]'
      }

    ]
  },
  plugins: [
    new JavaScriptObfuscator ({
    compact: false,
    controlFlowFlattening: false,
    deadCodeInjection: false,
    debugProtection: false,
    debugProtectionInterval: false,
    disableConsoleOutput: true,
    identifierNamesGenerator: 'hexadecimal',
    log: false,
    renameGlobals: false,
    rotateStringArray: true,
    selfDefending: true,
    stringArray: true,
    stringArrayEncoding: false,
    stringArrayThreshold: 0.75,
    unicodeEscapeSequence: false
    }, []),

    new HtmlWebPackPlugin({
      template: "./src/index.html",
      filename: "./index.html"
    }),
    new ExtractTextPlugin("./styles.css")
  ]
};

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
sanex3339commented, Mar 11, 2018

Try to disable selfDefending option. It will work?

1reaction
sanex3339commented, Mar 11, 2018

Looks like something was modified obfuscated code and this triggered self defending mechanism. Your error is self defending mechanism.

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Maximum call stack size exceeded error
It means that somewhere in your code, you are calling a function which in turn calls another function and so forth, until you...
Read more >
JavaScript Error: Maximum Call Stack Size Exceeded
If you see the “Maximum Call Stack Size Exceeded” error, there's likely a problem with a recursive function within your JavaScript code.
Read more >
Uncaught RangeError: Maximum call ... - Net-Informations.Com
This error is almost always means you have a problem with recursion in JavaScript code, as there isn't any other way in JavaScript...
Read more >
How to fix: "RangeError: Maximum call stack size exceeded"
A "RangeError: Maximum call stack size exceeded" is an error that occurs when a function or operation tries to execute too many nested...
Read more >
RangeError: Maximum call stack size exceeded - Educative.io
The most common source for this error is infinite recursion. You must have a recursive function in your code whose base case is...
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