You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A JavaScript error occurred in the main process
Uncaught Exception:
Error: EPIPE: broken pipe, write
at Socket._write (node:internal/net:75:18)
at writeOrBuffer (node:internal/streams/writable:574:12)
at _write (node:internal/streams/writable:503:10)
at Writable.write (node:internal/streams/writable:512:10)
at [kWriteToConsole] (node:internal/console/constructor:311:16)
at console.info (node:internal/console/constructor:421:26)
at NsisUpdater.checkForUpdates (electron-updater/out/AppUpdater.js)
at DesktopUpdateCoordinator.doCheck (lib/main.js)
at DesktopUpdateCoordinator.check (lib/main.js)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
环境
现象
启动后弹出 Electron 崩溃对话框:
A JavaScript error occurred in the main process Uncaught Exception: Error: EPIPE: broken pipe, write at Socket._write (node:internal/net:75:18) at writeOrBuffer (node:internal/streams/writable:574:12) at _write (node:internal/streams/writable:503:10) at Writable.write (node:internal/streams/writable:512:10) at [kWriteToConsole] (node:internal/console/constructor:311:16) at console.info (node:internal/console/constructor:421:26) at NsisUpdater.checkForUpdates (electron-updater/out/AppUpdater.js) at DesktopUpdateCoordinator.doCheck (lib/main.js) at DesktopUpdateCoordinator.check (lib/main.js)复现步骤
直接双击启动不太容易触发(但是在使用过程中会崩溃),因此该问题在命令行/被托管启动时更容易暴露。
根因分析
建议修复
在主进程入口尽早注册流错误处理,并建议给 updater 配置非 console logger:
可选:将 autoUpdater.logger 设为文件日志或 NoOpLogger,避免更新库直接写 console。
期望行为
stdout/stderr 断开不应导致主进程崩溃或弹出 Uncaught Exception;更新检查失败应只体现为状态错误。
其他关联
这个和 #9904 和 #4059 三者应该可以算是同属“传输层错误未被捕获升级为致命异常”的系统性问题。
All reactions