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.

Maximum call stack size exceeded

See original GitHub issue

🐛 Bug Report

When running acceptance tests, I am sometimes getting a maximum call stack size error.

RangeError: Maximum call stack size exceeded
        at Function.[Symbol.hasInstance] (<anonymous>)
      at WriteStream (node_modules/graceful-fs/graceful-fs.js:200:14)
      at WriteStream (node_modules/graceful-fs/graceful-fs.js:201:29)
      at WriteStream (node_modules/graceful-fs/graceful-fs.js:201:29)
      at WriteStream (node_modules/graceful-fs/graceful-fs.js:201:29)
      at WriteStream (node_modules/graceful-fs/graceful-fs.js:201:29)
      at WriteStream (node_modules/graceful-fs/graceful-fs.js:201:29)
      at WriteStream (node_modules/graceful-fs/graceful-fs.js:201:29)
      at WriteStream (node_modules/graceful-fs/graceful-fs.js:201:29)
      at WriteStream (node_modules/graceful-fs/graceful-fs.js:201:29)

To Reproduce

Sorry, but I cannot reproduce it 100%. It sometimes happens when I create a writable stream:

const fs = require('fs');

describe('xxx', () => {
  it('will sometimes exit on max call stack', () => {
    fs.createWriteStream('test.log', { flags: 'a' })
  })
})

Expected behavior

Does not crash on max. call stack.

Link to repl or repo (highly encouraged)

It seems to sometimes reproduce on this repository: https://github.com/alesmenzel/churchill

when running the npm run test:acceptance -- file here is a screenshot from travis-ci running the tests ( https://prnt.sc/pkr5zy )

envinfo

System:
    OS: macOS Mojave 10.14.6
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
  Binaries:
    Node: 12.12.0 - ~/.nvm/versions/node/v12.12.0/bin/node
    Yarn: 1.17.3 - ~/.nvm/versions/node/v10.16.0/bin/yarn
    npm: 6.11.3 - ~/.nvm/versions/node/v12.12.0/bin/npm
  npmPackages:
    jest: ^24.9.0 => 24.9.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

3reactions
katlimruizcommented, Dec 27, 2019

+1 If it helps, I tried a second time npm i --save-dev jest and it worked this time,

1reaction
sawyerhcommented, Oct 24, 2019

Looks like this was resolved in v4.2.3 of graceful-fs: https://github.com/isaacs/node-graceful-fs/issues/174

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 >
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 >
Uncaught RangeError: Maximum call ... - Net-Informations.Com
Maximum call stack size exceeded error ... This error is almost always means you have a problem with recursion in JavaScript code, as...
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 >

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