nojsja/electron-re

Attention of Electron child_process bugs!!

nojsja opened this issue · 2 comments

ChildProcessPool has abnormal behavior in electron production app.

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.

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,
   ...
}