Skip to content

fix: only set Node's WASM streaming callback when fetch is enabled#51953

Merged
MarshallOfSound merged 2 commits into
mainfrom
fix/wasm-streaming-renderer-crash
Jun 10, 2026
Merged

fix: only set Node's WASM streaming callback when fetch is enabled#51953
MarshallOfSound merged 2 commits into
mainfrom
fix/wasm-streaming-renderer-crash

Conversation

@MarshallOfSound

Copy link
Copy Markdown
Member

Fixes #51950

Description of Change

Node.js v24.16.0 removed the experimental_fetch gate around isolate->SetWasmStreamingCallback() (nodejs/node#62759). When fix_allow_disabling_fetch_in_renderer_and_worker_processes.patch was rebased for the Node bump, the flag was restored but that gate was not.

As a result, Node.js unconditionally overrode Blink's WebAssembly streaming callback in renderer and worker processes — where we pass --no-experimental-fetch and never register Node's JS-side streaming implementation. Any WebAssembly.compileStreaming() / instantiateStreaming() call in a renderer with nodeIntegration: true then failed the CHECK(!impl.IsEmpty()) assertion in node_wasm_web_api.cc and crashed the renderer.

This restores the gate (matching the v24.15.0 behavior) so Blink's streaming callback stays installed in processes where Node's fetch is disabled, and adds a regression test. Browser, utility, and ELECTRON_RUN_AS_NODE processes are unaffected — fetch is enabled there, so Node's streaming implementation is still installed.

Checklist

  • PR description included and stakeholders cc'd
  • npm test passes
  • tests are added/changed

Release Notes

Notes: Fixed a renderer crash when calling WebAssembly.compileStreaming() or WebAssembly.instantiateStreaming() with nodeIntegration enabled.

Node.js v24.16.0 removed the experimental_fetch gate around
isolate->SetWasmStreamingCallback() (nodejs/node#62759). When
fix_allow_disabling_fetch_in_renderer_and_worker_processes.patch was
rebased for the version bump, the flag was restored but the gate was
not.

As a result, Node.js unconditionally overrode Blink's WebAssembly
streaming callback in renderer and worker processes, where Electron
passes --no-experimental-fetch and skips the bootstrap file that
registers Node's JS-side streaming implementation. Any call to
WebAssembly.compileStreaming() or instantiateStreaming() in a renderer
with nodeIntegration then failed the CHECK(\!impl.IsEmpty()) assertion
in node_wasm_web_api.cc and crashed the renderer.

Restore the gate so Blink's streaming callback stays in place in
processes where Node's fetch is disabled.

Fixes #51950
@MarshallOfSound MarshallOfSound requested a review from a team as a code owner June 10, 2026 15:39
@MarshallOfSound MarshallOfSound added semver/patch backwards-compatible bug fixes target/41-x-y PR should also be added to the "41-x-y" branch. target/42-x-y PR should also be added to the "42-x-y" branch. target/43-x-y PR should also be added to the "43-x-y" branch. labels Jun 10, 2026
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Jun 10, 2026
@deepak1556

Copy link
Copy Markdown
Member

Thoughts on #51923, that would also address the broken code path. I am fine with either just want to get consensus on which change to land to address the issue.

@deepak1556

Copy link
Copy Markdown
Member

This is addressing the callback registered on the isolate, which #51923 doesn't cover yet. Approving as an immediate regression fix.

@dsanders11 dsanders11 added target/41-x-y PR should also be added to the "41-x-y" branch. and removed target/41-x-y PR should also be added to the "41-x-y" branch. labels Jun 10, 2026
@MarshallOfSound MarshallOfSound merged commit 82a5b7b into main Jun 10, 2026
141 of 143 checks passed
@MarshallOfSound MarshallOfSound deleted the fix/wasm-streaming-renderer-crash branch June 10, 2026 19:25
@release-clerk

release-clerk Bot commented Jun 10, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed a renderer crash when calling WebAssembly.compileStreaming() or WebAssembly.instantiateStreaming() with nodeIntegration enabled.

@trop

trop Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "41-x-y" cleanly;
you will need to perform this backport manually.

@trop trop Bot added needs-manual-bp/41-x-y and removed target/41-x-y PR should also be added to the "41-x-y" branch. labels Jun 10, 2026
@trop

trop Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "43-x-y", please check out #51955

@trop trop Bot added in-flight/43-x-y and removed target/43-x-y PR should also be added to the "43-x-y" branch. labels Jun 10, 2026
@trop

trop Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "42-x-y", please check out #51956

@trop trop Bot added in-flight/42-x-y and removed target/42-x-y PR should also be added to the "42-x-y" branch. in-flight/43-x-y labels Jun 10, 2026
@trop trop Bot added merged/43-x-y PR was merged to the "43-x-y" branch. merged/42-x-y PR was merged to the "42-x-y" branch. and removed in-flight/42-x-y labels Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/42-x-y PR was merged to the "42-x-y" branch. merged/43-x-y PR was merged to the "43-x-y" branch. needs-manual-bp/41-x-y new-pr 🌱 PR opened recently semver/patch backwards-compatible bug fixes

Projects

None yet

3 participants