有没有一种方法可以避免此错误:(节点)警告:递归process.nextTick被检测到 [英] Is there a way to avoid this error: (node) warning: Recursive process.nextTick detected
问题描述
我看到了与此错误有关的一堆问题,但似乎没有人提供实际答案,其他张贴者列出的原因也都不适用于我的情况.
I'm seeing a bunch of questions around this error but no one seems to have an actual answer and none of the causes listed by the other posters apply to my case.
当我从服务器上将一个特别大的文件(50mb或更大)上传到Amazon的S3时,我已经追踪到了这种情况.在此过程中的某个地方,我得到了数百个
I've tracked it down to happening when I upload a particularly large file (50mb or more) from my server over to Amazon's S3. Somewhere in that process I get several hundred instances of
(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.
,最后是
var str = String(f).replace(formatRegExp, function(x) {
^
RangeError: Maximum call stack size exceeded
好奇是否还有其他人看到了此特定实例并设法找到解决方案.如果我弄清楚了,我显然会发布一个作为答案.
Curious if anyone else has seen this specific instance and managed to find a solution. I'll obviously post one as an answer if I figure it out.
推荐答案
要真正解决此问题,您必须
To actually fix this you must
- 标识导致此问题的代码行.
- 在代码和npm依赖项中搜索
process.nextTick
- 或者,如果您可以在调试器中重现并在引发该错误的节点核心中的代码处设置断点,则可以查看该点处的堆栈并确定根本原因文件/行. li>
- 在代码和npm依赖项中搜索
- 不一定是您的应用代码是根本原因,因此您可能需要派生/PR第三方模块
这篇关于有没有一种方法可以避免此错误:(节点)警告:递归process.nextTick被检测到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!