mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Upstream DevTools' HostRuntime checks `IS_NODE` before `IS_BROWSER` when selecting the platform runtime. In Electron, `process` is available in renderer processes, so `IS_NODE` evaluates to `true` in the DevTools context. This causes DevTools to dynamically import the Node.js platform runtime, which uses `node:worker_threads`. DevTools Web Workers running under the `devtools://` protocol cannot load Node.js built-in modules, so the import fails and breaks features like the formatter worker. Fix by swapping the check order to prefer `IS_BROWSER` when both are true. This is safe because in pure Node.js environments (the only case where the node runtime is needed), `window` and `self` are both undefined, so `IS_BROWSER` is always `false` regardless of check order. Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
3 lines
125 B
Plaintext
3 lines
125 B
Plaintext
chore_expose_ui_to_allow_electron_to_set_dock_side.patch
|
|
fix_prefer_browser_runtime_over_node_in_hostruntime_detection.patch
|