Skip to content

feat: Throw an error when WebAssembly is not available. - #5966

Merged
mcollina merged 1 commit into
nodejs:mainfrom
ShogunPanda:detect-wasm
Oct 5, 2026
Merged

mcollina merged 1 commit into
nodejs:mainfrom
ShogunPanda:detect-wasm

Conversation

@ShogunPanda

Copy link
Copy Markdown
Contributor

Summary

Report a recognizable, informative error when WebAssembly is unavailable for HTTP/1 parsing, while preserving APIs that do not require the parser. Client and dispatcher requests receive ERR_WEBASSEMBLY_NOT_SUPPORTED directly; fetch preserves it in error.cause.

Changes

  • Define the error locally, independently of Node.js internal errors.
  • Check WebAssembly availability during lazy parser initialization and defer Milo’s WASM loading.
  • Preserve the SIMD → non-SIMD fallback.
  • Add coverage for unavailable WASM, --jitless, Milo, error propagation, process usability, and WASM-independent APIs.
  • Update TypeScript declarations and document the HTTP/1 requirement and fetch error cause.

Notes

Node.js integration requires a normal vendored Undici update. No alternative HTTP/1 parser is provided when WebAssembly is unavailable.

Assisted-By: OpenAI:GPT-6.1 Sol <openai/gpt-6.1-sol>
Related to nodejs/node#66533.

Signed-off-by: Paolo Insogna <paolo@cowtech.it>
@codecov-commenter

codecov-commenter commented Oct 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.92%. Comparing base (f850c68) to head (ba9ed8c).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
lib/core/errors.js 76.47% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5966      +/-   ##
==========================================
+ Coverage   86.11%   86.92%   +0.80%     
==========================================
  Files         115      115              
  Lines       45686    45749      +63     
==========================================
+ Hits        39343    39767     +424     
+ Misses       6343     5982     -361     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina
mcollina merged commit 9ec5a2e into nodejs:main Oct 5, 2026
33 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants