Search code examples
node.jsgulpelectronelectron-forge

Electron forge start is broken by Gulp


please help because this thing is driving me crazy. In short when gulp reference is added to electron-forge project app launch fails.

  • Node: v8.11.3
  • electron-forge: v5.2.2

Package.js snippet:

"dependencies": {
    "electron-squirrel-startup": "^1.0.0",
    "electron-compile": "6.4.3"
},
"devDependencies": {
    "electron": "2.0.4",
    "electron-forge": "^5.2.2",
    "electron-prebuilt-compile": "2.0.4",
    "gulp": "^3.9.1"
}

Steps to reproduce:

electron-forge init gulptest
npm install electron-prebuilt-compile -D
npm install gulp -D

Add electron-prebuilt-compile to devDependencies in package.json

npm run start

App will start normally, but if only one line is added to the index.js start command fails.

const gulp = require('gulp');

Once started console will output error with description:

c:\projects\electron\vendor\node\src\async-wrap.cc:357 Assertion 'env->async_hooks_init_function().IsEmpty()' failed.


Solution

  • This is electron issue. There is a bug opened for this and it will be fixed in one of the future releases.