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.

"RangeError: Maximum call stack size exceeded" and "warning: Recursive process.nextTick detected"

See original GitHub issue

For the first time I test Nedb, I encounter that problem. My code is very simple:

var Datastore = require('nedb')
  , db = new Datastore({ filename: '.\\my.db', autoload: true });

function test() {
    db.update({ '0': 10 }, { $inc: { distance: 38 } }, { upsert: true }, function (err) {
        if(err) {
            console.log('Oops!');
        } else {
            db.count({ '0': 10 }, function (err, count) {
                console.log('Count: ' + count);
            });
            console.log('Yeah!');
        }
    });
}

for(var i=0; i < 1000; i++) {
    test();
}

I don’t think it’s my fault but I can’t find root cause of this problem (I am newbie so…). Much appreciate for your help. BTW, I ran it on Windows 8 64bit using node v0.10.28 x64 official binary.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
louischatriotcommented, Aug 21, 2014

This was indeed an issue caused by process.nextTick. Now setImmediate is used and the bug was fixed, as of v0.10.11

0reactions
khuongduybuicommented, Jun 17, 2014

Like I said in the previous comment (https://github.com/louischatriot/nedb/issues/177#issuecomment-46116633) setImmediate will start a new call stack. Used at the right place, it can split your 1000x call stacks to 1000 stacks with the length of x 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

(node) warning: Recursive process.nextTick detected - RangeError ...
I had the same problem and this solution worked for me in Ubuntu 12.04: grunt throw “Recursive process.nextTick detected”.
Read more >
JavaScript RangeError: Maximum Call Stack Size Exceeded
The RangeError: Maximum call stack size exceeded is thrown when a function call is made that exceeds the call stack size. This can...
Read more >
Uncaught RangeError: Maximum call stack size exceeded
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 >
InternalError: too much recursion - JavaScript - MDN Web Docs
The JavaScript exception "too much recursion" or "Maximum call stack size exceeded" occurs when there are too many function calls, or a function...
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