nojsja / electron-re

Electron process manager and more...
GNU General Public License v3.0
53 stars 12 forks source link

Attention of Electron child_process bugs!! #1

Open nojsja opened 3 years ago

nojsja commented 3 years ago

ChildProcessPool has abnormal behavior in electron production app.

nojsja commented 3 years ago

Fixed the crash of ChildProcessPool on electron-re@1.2.4. DO NOT USE require(' Electron ') in the child process execution script, this will cause fatal error in the production environment. It's a bug of Electron, there is no solution yet.

nojsja commented 2 years ago

Besides that, In order to use ChildProcessPool, you need to place your child_process exec js file in an external directory such as ~/.config/. Otherwise, when you packaged your app, Node.js can not find that exec file.

The another way to solve this problem is to set asar to false in the electron-builder.json, this is not recommended but works.

{
   ...
   "asar": false,
   ...
}