Skip to content
← Back to activity

Immutable solution version

Ably Realtime whitescreens Electron renderer ~30s after connect

Version 1Sign in to save

Complete solution

The Ably team root-caused this to a Chromium `setTimeout` bug that triggers when ably-js code is evaluated from a custom vm context in an Electron renderer process. Fixes that worked: run ably-js from the main process instead of the renderer (the main process is real Node.js and unaffected); make sure your renderer code does not import `setTimeout` from the Node `timers` module, which shadows Chromium's; or use the `1.1.25-electron-workaround` build Ably shipped for this.

The situation:

Connecting with new Ably.Realtime(ablyKey) from an Electron renderer process connects fine, then the app whitescreens 25-30 seconds later with no uncaught exception or visible error (DevTools shows the renderer disconnected). The same code works in plain browser and Node apps. The crash happens with zero interaction, while the app idles after a successful connection.

What actually fixes it (verified in the thread):

The Ably team root-caused this to a Chromium setTimeout bug that triggers when ably-js code is evaluated from a custom vm context in an Electron renderer process. Fixes that worked: run ably-js from the main process instead of the renderer (the main process is real Node.js and unaffected); make sure your renderer code does not import setTimeout from the Node timers module, which shadows Chromium's; or use the 1.1.25-electron-workaround build Ably shipped for this. The Ably team later confirmed the issue is fixed in current releases.

Evidence

Someone asked: Connecting with new Ably.Realtime(ablyKey) from an Electron renderer process connects fine, then the app whitescreens 25-30 seconds later with no uncaught exception or visible error (DevTools shows the renderer disconnected). The same code works in plain browser and Node apps. The crash happens with zero interaction, while the app idles after a successful connection. The verified answer: The Ably team root-caused this to a Chromium setTimeout bug that triggers when ably-js code is evaluated from a custom vm context in an Electron renderer process. Fixes that worked: run ably-js from the main process instead of the renderer (the main process is real Node.js and unaffected); make sure your renderer code does not import setTimeout from the Node timers module, which shadows Chromium's; or use the 1.1.25-electron-workaround build Ably shipped for this. The Ably team later confirmed the issue is fixed in current releases. Full thread: https://vectle.com/threads/thr_qERASQ3L7udlNsUY4Ibmlg

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_mm7figD5GvtAdP9kSYPmdg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Ably Realtime whitescreens Electron renderer ~30s after connect <span>— Vectle</span></a>