偶尔,当我在Docker容器中运行Electron时,我得到以下错误:
[15:1102/154337.143944:ERROR:network_service_instance_impl.cc(333)] Network service crashed, restarting service.
这会导致在本地主机上部分呈现加载了win.loadURL
的前端应用程序
这个问题似乎与https://bbs.archlinux.org/viewtopic.php?id=268123非常相似,但建议中的任何内容都不起作用。
运行最新的Electron 15.0.2
和Chromedriver 95.0.0
此外,当关闭电子窗口时,我得到一个错误
Error: ERR_FAILED (-2) loading 'https://localhost:{port}/{path_to}/index.html'
at rejectAndCleanup (node:electron/js2c/browser_init:165:7486)
at Object.stopLoadingListener (node:electron/js2c/browser_init:165:7861)
at Object.emit (node:events:394:28) {
errno: -2,
code: 'ERR_FAILED',
url: 'https://localhost:{port}/{path_to}/index.html'
} [EOL]
在执行await win.loadURL(url)
时在main.js内部捕获的
此外,在电子浏览器窗口的控制台日志中,会出现以下错误:
ERROR Error: Uncaught (in promise): ChunkLoadError: Loading chunk 108 failed.
(timeout: https://localhost:{port}/{path_to}/108.da4993913b4a27951976.js)
ChunkLoadError: Loading chunk 108 failed.
以前有没有人遇到过这个问题?
发布于 2021-11-03 15:28:32
我设法找到了触发问题的原因,而不是根本原因。
我注释掉了setCertificateVerifyProc
电子钩子,这个问题似乎不再出现了。
// win.webContents.session.setCertificateVerifyProc((request, callback) => {
// callback(-3);
// });
在Electron docs中有一个有趣的注释,声明:
NOTE: The result of this procedure is cached by the network service.
这实际上反映在日志上
network_service_instance_impl.cc(333)] Network service crashed
如果您需要有关此问题的更多信息,请关注电子Github官方问题页面https://github.com/electron/electron/issues/31675
https://stackoverflow.com/questions/69813387
复制相似问题