Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: write EPIPE when killElectron #1988

Open
mzisnm opened this issue Oct 6, 2023 · 0 comments
Open

Error: write EPIPE when killElectron #1988

mzisnm opened this issue Oct 6, 2023 · 0 comments

Comments

@mzisnm
Copy link

mzisnm commented Oct 6, 2023

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

  • Bundling main process...
    ✔ Bundling main process...
    | Bundling main process...

DONE Compiled successfully in 3549ms 10:58:19

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\index.js 726.25 KiB 166.02 KiB

Images and other types of assets omitted.
Build at: 2023-10-06T02:58:20.038Z - Hash: 64e9810223dd91fc2e54 - Time: 3549ms

DONE Compiled successfully in 4448ms 10:58:20

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\index.js 726.25 KiB 166.02 KiB

Images and other types of assets omitted.
Build at: 2023-10-06T02:58:20.712Z - Hash: 64e9810223dd91fc2e54 - Time: 4448ms

DONE Compiled successfully in 2219ms 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:22.854Z - Hash: 232e737ab97dabc332b7 - Time: 2219ms

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).

  • custom config for vcp-electron-builder:
    chainWebpackMainProcess: (config) => {
    // Chain webpack config for electron main process only
    config.externals({
    'cheerio': "require('cheerio')",
    'fs': "require('fs')",
    'XLSX': 'require("xlsx")',
    });
    config.target('electron-main').entry('mofang').add(resolve('src/main/mofang.js'));
    config.target('electron-main').entry('ccb').add(resolve('src/main/ccb.js'));
    config.target('electron-main').entry('boyu').add(resolve('src/main/boyu.js'));
    config.target('electron-main').entry('lingyu').add(resolve('src/main/lingyu.js'));
    config.target('electron-main').entry('longhu').add(resolve('src/main/longhu.js'));
    config.target('electron-main').entry('lehu').add(resolve('src/main/lehu.js'));
    config.target('electron-main').entry('baoli').add(resolve('src/main/baoli.js'));
    config.target('electron-main').entry('woqu').add(resolve('src/main/woqu.js'));
    config.target('electron-main').entry('big').add(resolve('src/main/big.js'));
    config.target('electron-main').entry('chengjia').add(resolve('src/main/chengjia.js'));
    config.target('electron-main').entry('fangyu').add(resolve('src/main/fangyu.js'));
    config.target('electron-main').entry('anxin').add(resolve('src/main/anxin.js'));

    },
    mainProcessWatch: ['src/main/*']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant