首页 > 解决方案 > Gatsby / Docker 导致 MaxListenersExceededWarning

问题描述

我在这里遇到了一个非常奇怪的问题。

首先,当我在我的电脑上运行本地构建时,Gatsby Build我没有任何错误,但是一旦在我们的外部机构 Gatbsy 的 Docker 环境中开始构建,就会抛出这个错误:

error 26-Oct-2020 23:41:19 error (node:8878) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added. Use emitter.setMaxListeners() to increase limit

但是构建通过了,因为这并没有阻止它完成构建,所以最后我们收到了来自 Gatsby 的成功消息:

build   26-Oct-2020 23:42:21    The following pages will be precached:
build   26-Oct-2020 23:42:21    /offline-plugin-app-shell-fallback/index.html
build   26-Oct-2020 23:42:21    success onPostBuild - 0.046s
build   26-Oct-2020 23:42:21    info Done building in 65.88 sec

这很好,但是在 Docker 中立即发生了这种情况:

error   26-Oct-2020 23:42:32    
Unable to publish artifact [Code]: 
Unable to publish artifact Required shared artifact: 
[Code], pattern: [**/**] for PRIVATE-JOB via com.atlassian.bamboo.build.artifact.S3ArtifactHandler@4d1aff73 
error   26-Oct-2020 23:42:32    The artifact is required, build will now fail.
simple  26-Oct-2020 23:42:32    The artifact hasn't been successfully published after 8.939 s

他们说这可能是因为 EventEmitter 内存泄漏,但我在本地机器上构建期间没有那个错误,所以几乎不可能调试它。

有没有人知道可能导致此问题的原因,可能是 Node.js 版本不匹配吗?

标签: javascriptreactjsdockergatsby

解决方案


推荐阅读