AvianFlu / ncp

Asynchronous recursive file copying with Node.js.
MIT License
681 stars 103 forks source link

recursive process.nextTick broken in latest io.js and node.js #83

Closed MylesBorins closed 9 years ago

MylesBorins commented 9 years ago

I'm unsure as to why ncp is not throwing this error, but node is supposed to throw when writing an recursive function that uses process.nexTick.

(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.

It looks like the current implementation found at --> https://github.com/AvianFlu/ncp/blob/master/lib/ncp.js#L55-L61 is blocking the thread... makes me sad.

I'm looking at ways to fix this, but commenting out the three lines that call to defer does stop ncp form breaking on iojs and node 0.12

/cc @AvianFlu

MylesBorins commented 9 years ago

This appears to be a dupe of #79

The broken "modern" check is what is causing this bug as well, since process.nextTick is being used instead of setImmediate