<p dir="auto">I am using Electron 0.35.0 32 bit on Windows 10 and I am getting the following error when after and SSL request is made using the https node module.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/14017241/11718956/ca2b45e0-9f58-11e5-9f6e-465d79338f29.png"><img src="https://cloud.githubusercontent.com/assets/14017241/11718956/ca2b45e0-9f58-11e5-9f6e-465d79338f29.png" alt="setimmediate2" style="max-width: 100%;"></a></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/14017241/11718974/dfdda6bc-9f58-11e5-8d91-aee177dae031.png"><img src="https://cloud.githubusercontent.com/assets/14017241/11718974/dfdda6bc-9f58-11e5-8d91-aee177dae031.png" alt="setimmediate1" style="max-width: 100%;"></a></p>
<p dir="auto">Looks like it is related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="107655166" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/2866" data-hovercard-type="pull_request" data-hovercard-url="/electron/electron/pull/2866/hovercard" href="https://github.com/electron/electron/pull/2866">#2866</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="108545655" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/2916" data-hovercard-type="issue" data-hovercard-url="/electron/electron/issues/2916/hovercard" href="https://github.com/electron/electron/issues/2916">#2916</a> and solution would be similar: NativeModule.require('timers').setImmediate(destroySSL, this);</p>
<p dir="auto">Summary: When <code class="notranslate">node-integration</code> is set to false, <code class="notranslate">setImmediate</code> is <code class="notranslate">undefined</code> in the preload script.</p>
<p dir="auto">I am using a using:</p>
<ul dir="auto">
<li>a <code class="notranslate">preload</code> script</li>
<li><code class="notranslate">node-integration: false</code></li>
<li>At some point in the <code class="notranslate">preload</code> script I am making HTPP requests (using the <code class="notranslate">request</code> module).</li>
</ul>
<p dir="auto">Each time I perform such a request, I got an error because <code class="notranslate">setImmediate</code> is <code class="notranslate">undefined</code>. <code class="notranslate">setImmediate</code> is used in the file <code class="notranslate">_tls_wrap.js</code> <a href="https://github.com/nodejs/node/blob/master/lib/_tls_wrap.js#L340">see line 340</a>.</p>
<p dir="auto">In the <a href="https://github.com/atom/electron/blob/a6b7dd22e8f1fed48c16af307ff222114d7c8ba8/spec/webview-spec.coffee#L87">tests</a>, it is explicitly tested that <code class="notranslate">[typeof process, typeof setImmediate, typeof global].join(' ')</code> is evaluated to <code class="notranslate">'object undefined object'</code>.</p>
<p dir="auto">Why is <code class="notranslate">setImmediate</code> undefined in the preload script?<br>
What solution/workaround exists for this use case ?</p>
<p dir="auto">Thanks in advance.</p>