Fluffy
Fluffy

Reputation: 28362

How to debug "warning: Recursive process.nextTick detected. This will break in the next version of node."

Is there a way to trace the location of process.nextTick being called recursively? E.g. in this case,

var normal = function(cb) {
    process.nextTick(cb);
}

var bad = function() {
    process.nextTick(bad);
};

normal(function() {
    bad();
});

That the problem is on line 5 in function "bad"?

Upvotes: 4

Views: 290

Answers (1)

Liedman
Liedman

Reputation: 10329

You can use the node command line switch --throw-deprecation to turn the warning into a thrown exception, which will give you a stack trace to debug from.

Upvotes: 2

Related Questions