Open
Description
Version
v22.13.1
Platform
Linux localhost 6.13.1-1-default #1 SMP PREEMPT_DYNAMIC Mon Feb 3 05:33:25 UTC 2025 (1918d13) x86_64 x86_64 x86_64 GNU/Linux
Subsystem
worker_threads
What steps will reproduce the bug?
Run this command:
node --jitless -e 'const { port1, port2 } = new MessageChannel(); port1.addEventListener("message", () => {}); port2.postMessage(null);'
or run this script with --jitless
const { port1, port2 } = new MessageChannel();
port1.addEventListener("message", () => {});
port2.postMessage(null);
How often does it reproduce? Is there a required condition?
Every time
What is the expected behavior? Why is that the expected behavior?
No exception should be thrown, undici
should not be loaded when fetch is not needed.
What do you see instead?
> node --jitless -e 'const { port1, port2 } = new MessageChannel(); port1.addEventListener("message", () => {}); port2.postMessage(null);'
Warning: disabling flag --expose_wasm due to conflicting flags
node:internal/deps/undici/undici:5827
mod = await WebAssembly.compile(llhttpWasmData || require_llhttp_wasm());
^
ReferenceError: WebAssembly is not defined
at lazyllhttp (node:internal/deps/undici/undici:5827:9)
at lib/dispatcher/client-h1.js (node:internal/deps/undici/undici:5873:25)
at __require (node:internal/deps/undici/undici:6:50)
at lib/dispatcher/client.js (node:internal/deps/undici/undici:7607:21)
at __require (node:internal/deps/undici/undici:6:50)
at lib/dispatcher/pool.js (node:internal/deps/undici/undici:8068:18)
at __require (node:internal/deps/undici/undici:6:50)
at lib/dispatcher/agent.js (node:internal/deps/undici/undici:8151:16)
at __require (node:internal/deps/undici/undici:6:50)
at lib/global.js (node:internal/deps/undici/undici:8251:17)
Node.js v22.13.1
Additional information
I believe this is due to constructing the MessageEvent
, which appears to come from undici
:
node/lib/internal/worker/io.js
Line 98 in 4006d5e
Metadata
Metadata
Assignees
Type
Projects
Status
Awaiting Triage