nklayman / vue-cli-plugin-electron-builder

Easily Build Your Vue.js App For Desktop With Electron
https://nklayman.github.io/vue-cli-plugin-electron-builder/
MIT License
4.12k stars 279 forks source link

Error: write EPIPE when killElectron #1988

Open mzisnm opened 9 months ago

mzisnm commented 9 months ago

Describe the bug I think it's caused by killing electron multiple times. Looking at the Bundling log below, it appears that the Bundling process was executed twice. I added a log line "console.info('stop', currentChild.pid)" to the index.js file before kill gracefully, and this log output twice,The pid is the same both times. I don't know much about webpack, maybe there's something wrong with my configuration, which is at the back. To Reproduce When saving file changes in the src/main folder

Screenshots Bundling log

stop 448752

DONE Compiled successfully in 2145ms 10:58:22

File Size Gzipped

dist_electron\ccb.js 1637.85 KiB 349.75 KiB dist_electron\lingyu.js 1637.64 KiB 349.34 KiB dist_electron\chengjia.js 1635.47 KiB 349.20 KiB dist_electron\big.js 1635.28 KiB 349.09 KiB dist_electron\lehu.js 1635.01 KiB 349.09 KiB dist_electron\longhu.js 1634.63 KiB 349.02 KiB dist_electron\boyu.js 1634.56 KiB 349.02 KiB dist_electron\mofang.js 1634.33 KiB 348.97 KiB dist_electron\baoli.js 1633.87 KiB 348.87 KiB dist_electron\woqu.js 1633.84 KiB 348.85 KiB dist_electron\fangyu.js 1633.55 KiB 348.75 KiB dist_electron\anxin.js 1632.90 KiB 348.51 KiB dist_electron\preload.js 4.99 KiB 1.39 KiB

Images and other types of assets omitted. Build at: 2023-10-06T02:58:23.744Z - Hash: 232e737ab97dabc332b7 - Time: 2145ms

stop 448752 node:internal/errors:478 ErrorCaptureStackTrace(err); ^

Error: write EPIPE at ChildProcess.target._send (node:internal/child_process:874:20) at ChildProcess.target.send (node:internal/child_process:747:19) at E:\workspace-vscode\apartment-data\node_modules\vue-cli-plugin-electron-builder\index.js:395:28 at new Promise () at killElectron (E:\workspace-vscode\apartment-data\node_modules\vue-cli-plugin-electron-builder\index.js:381:9) at launchElectron (E:\workspace-vscode\apartment-data\node_modules\vue-cli-plugin-electron-builder\index.js:460:15) at E:\workspace-vscode\apartment-data\node_modules\vue-cli-plugin-electron-builder\index.js:355:17 at finalCallback (E:\workspace-vscode\apartment-data\node_modules\vue-cli-plugin-electron-builder\node_modules\webpack\lib\Compiler.js:257:39) at E:\workspace-vscode\apartment-data\node_modules\vue-cli-plugin-electron-builder\node_modules\webpack\lib\Compiler.js:306:14 at AsyncSeriesHook.eval [as callAsync] (eval at create (E:\workspace-vscode\apartment-data\node_modules\vue-cli-plugin-electron-builder\node_modules\tapable\lib\HookCodeFactory.js:33:10), :15:1) {
errno: -4047, code: 'EPIPE', syscall: 'write' }

Environment (please complete the following information): ps: Each js file in the src/main directory runs as a child process(use Electron api utilityProcess.fork).