<ul dir="auto">
<li>Electron version: 1.8.2</li>
<li>Operating system: OSX, Windows</li>
</ul>
<p dir="auto">Issue: Whenever <code class="notranslate">gulp = require("gulp");</code> is invoked, Electron 1.8.2 application crashes with "DevTools was disconnected from the page" message.</p>
<p dir="auto">Everything works fine with Electron 1.7.11.</p>
<ul dir="auto">
<li>Electron version: Anything over 1.7.8, until the latest 1.8.2-beta.1</li>
<li>Node:  8.8.0</li>
<li>Operating system: high sierra</li>
</ul>
<p dir="auto">Going over 1.7.8 seems to break Electron for one of our projects. It's hard to track down what's going on but here's the output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="❯ yarn run electron
yarn run v1.2.1
$ electron .dev/electron.js
/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron[41928]: ../../vendor/node/src/async-wrap.cc:399:void node::SetupHooks(const FunctionCallbackInfo&lt;v8::Value&gt; &amp;): Assertion `env-&gt;async_hooks_init_function().IsEmpty()' failed.
 1: node::Abort() [/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 2: node::Assert(char const* const (*) [4]) [/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 3: node::AsyncWrap::Initialize(v8::Local&lt;v8::Object&gt;, v8::Local&lt;v8::Value&gt;, v8::Local&lt;v8::Context&gt;) [/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 4: v8::internal::StrDup(char const*) [/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 5: v8::internal::compiler::BranchElimination::ControlPathConditions::operator==(v8::internal::compiler::BranchElimination::ControlPathConditions const&amp;) const [/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 6: v8::internal::compiler::BranchElimination::ControlPathConditions::operator==(v8::internal::compiler::BranchElimination::ControlPathConditions const&amp;) const [/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 7: 0x3eadf51843fd
 8: 0x3eadf527777c
 9: 0x3eadf523be1c
✨  Done in 0.40s."><pre class="notranslate"><code class="notranslate">❯ yarn run electron
yarn run v1.2.1
$ electron .dev/electron.js
/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron[41928]: ../../vendor/node/src/async-wrap.cc:399:void node::SetupHooks(const FunctionCallbackInfo&lt;v8::Value&gt; &amp;): Assertion `env-&gt;async_hooks_init_function().IsEmpty()' failed.
 1: node::Abort() [/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 2: node::Assert(char const* const (*) [4]) [/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 3: node::AsyncWrap::Initialize(v8::Local&lt;v8::Object&gt;, v8::Local&lt;v8::Value&gt;, v8::Local&lt;v8::Context&gt;) [/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 4: v8::internal::StrDup(char const*) [/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 5: v8::internal::compiler::BranchElimination::ControlPathConditions::operator==(v8::internal::compiler::BranchElimination::ControlPathConditions const&amp;) const [/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 6: v8::internal::compiler::BranchElimination::ControlPathConditions::operator==(v8::internal::compiler::BranchElimination::ControlPathConditions const&amp;) const [/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 7: 0x3eadf51843fd
 8: 0x3eadf527777c
 9: 0x3eadf523be1c
✨  Done in 0.40s.
</code></pre></div>
<p dir="auto">It happens when we require a file that has async/await calls in it, but nothing's yet executed. But the moment we go back to 1.7.8 it starts working again.</p>