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

Is there a way to track the location of process.nextTick , which is called recursively? For instance. in this case

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

What is the problem on line 5 of the bad function?

+4
source share
1 answer

You can use the node --throw-deprecation command line switch to turn the warning into an exception that will give you a stack trace for debugging.

+2
source

Source: https://habr.com/ru/post/1501259/


All Articles