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.

Bug: Maximum call stack size exceeded

See original GitHub issue

I added new DuplicatesPlugin() to my webpack config (node 12.8.1, npm 6.10.2, webpack 4.39.1) and after running webpack I eventually got RangeError: Maximum call stack size exceeded.

Here’s the stack trace (I trimmed the path to project out)

    at String.split (<anonymous>)
    at Object.exports.toPosixPath (node_modules/inspectpack/lib/util/files.js:34:38)
    at node_modules/inspectpack/lib/util/dependencies.js:44:54
    at Array.filter (<anonymous>)
    at _recurseDependencies (node_modules/inspectpack/lib/util/dependencies.js:143:10)
    at node_modules/inspectpack/lib/util/dependencies.js:187:32
    at Array.map (<anonymous>)
    at _recurseDependencies (node_modules/inspectpack/lib/util/dependencies.js:178:10)
    at node_modules/inspectpack/lib/util/dependencies.js:187:32
    at Array.map (<anonymous>)
    at _recurseDependencies (node_modules/inspectpack/lib/util/dependencies.js:178:10)
    at node_modules/inspectpack/lib/util/dependencies.js:187:32
    at Array.map (<anonymous>)
    at _recurseDependencies (node_modules/inspectpack/lib/util/dependencies.js:178:10)
    at node_modules/inspectpack/lib/util/dependencies.js:187:32
    at Array.map (<anonymous>)
    at _recurseDependencies (node_modules/inspectpack/lib/util/dependencies.js:178:10)
    ...

Running with verbose: true didn’t give any extra insight

I know probably informing you what’s in my package.json would help debug what’s going on, but we have a lot of packages so it’s tough to know what combination of packages is causing this issue. Is there a way for me to debug this further so that I know which combination of packages is responsible?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
ryan-roemercommented, Jan 17, 2020

Awesome – thanks!

I’ve been able to confirm the bug with a regression test at: https://github.com/FormidableLabs/inspectpack/compare/bug/recurse-deps (WIP branch)

Reproduction:

$ WEBPACK_VERSION=4 \
  WEBPACK_MODE=development \
  WEBPACK_CWD=../../test/fixtures/circular-deps \
  yarn build-test-wp

# ... <SNIPPED> ...
TODO RECURSE DEPS { filePath: '/Users/rye/scm/fmd/inspectpack/node_modules/es5-ext' }
TODO RECURSE DEPS { filePath: '/Users/rye/scm/fmd/inspectpack/node_modules/es6-symbol' }
TODO RECURSE DEPS { filePath: '/Users/rye/scm/fmd/inspectpack/node_modules/d' }
TODO RECURSE DEPS { filePath: '/Users/rye/scm/fmd/inspectpack/node_modules/es5-ext' }
TODO RECURSE DEPS { filePath: '/Users/rye/scm/fmd/inspectpack/node_modules/es6-symbol' }
TODO RECURSE DEPS { filePath: '/Users/rye/scm/fmd/inspectpack/node_modules/d' }
TODO RECURSE DEPS { filePath: '/Users/rye/scm/fmd/inspectpack/node_modules/es5-ext' }
TODO RECURSE DEPS { filePath: '/Users/rye/scm/fmd/inspectpack/node_modules/es6-symbol' }
TODO RECURSE DEPS { filePath: '/Users/rye/scm/fmd/inspectpack/node_modules/d' }
RangeError: Maximum call stack size exceeded
    at formatRaw (internal/util/inspect.js:814:15)
    at formatValue (internal/util/inspect.js:591:10)
    at inspect (internal/util/inspect.js:221:10)
    at formatWithOptions (internal/util/inspect.js:1693:40)
    at Object.Console.<computed> (internal/console/constructor.js:272:10)
    at Object.log (internal/console/constructor.js:282:61)
    at /Users/rye/scm/fmd/inspectpack/lib/util/dependencies.js:187:21
    at Array.map (<anonymous>)
    at _recurseDependencies (/Users/rye/scm/fmd/inspectpack/lib/util/dependencies.js:178:10)
    at /Users/rye/scm/fmd/inspectpack/lib/util/dependencies.js:188:32
    at Array.map (<anonymous>)
    at _recurseDependencies (/Users/rye/scm/fmd/inspectpack/lib/util/dependencies.js:178:10)
    at /Users/rye/scm/fmd/inspectpack/lib/util/dependencies.js:188:32
    at Array.map (<anonymous>)
    at _recurseDependencies (/Users/rye/scm/fmd/inspectpack/lib/util/dependencies.js:178:10)
    at /Users/rye/scm/fmd/inspectpack/lib/util/dependencies.js:188:32
    at Array.map (<anonymous>)
    at _recurseDependencies (/Users/rye/scm/fmd/inspectpack/lib/util/dependencies.js:178:10)
    at /Users/rye/scm/fmd/inspectpack/lib/util/dependencies.js:188:32
    at Array.map (<anonymous>)
    at _recurseDependencies (/Users/rye/scm/fmd/inspectpack/lib/util/dependencies.js:178:10)
    at /Users/rye/scm/fmd/inspectpack/lib/util/dependencies.js:188:32
    at Array.map (<anonymous>)
    at _recurseDependencies (/Users/rye/scm/fmd/inspectpack/lib/util/dependencies.js:178:10)
    at /Users/rye/scm/fmd/inspectpack/lib/util/dependencies.js:188:32
    at Array.map (<anonymous>)
    at _recurseDependencies (/Users/rye/scm/fmd/inspectpack/lib/util/dependencies.js:178:10)
    at /Users/rye/scm/fmd/inspectpack/lib/util/dependencies.js:188:32
    at Array.map (<anonymous>)
    at _recurseDependencies (/Users/rye/scm/fmd/inspectpack/lib/util/dependencies.js:178:10)
1reaction
ryan-roemercommented, Jan 17, 2020

Thanks for the research work!

inspectpack should handle circular dependencies (which usually result from npm/yarn flattening). Is there any chance you can identify a small code snippet that triggers those?

Read more comments on GitHub >

github_iconTop Results From Across the Web

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. More ......
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 >
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 >
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 >
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