undici: public request crashes reading length from undefined after llhttp loads #10889
Description
Summary
A clean public-entry undici@8.9.0 request fixture compiles and links all 111 source modules on current main (f88acdaa1b), including undici's llhttp WebAssembly dependency, but fails at runtime before completing the local request:
TypeError: Cannot read properties of undefined (reading 'length')
at <anonymous>
This is the current verified undici blocker.
Reproduction shape
- Install
undici@8.9.0. - Add
undicitoperry.compilePackages. - Import
{ request }from the publicundicientry point. - Start a local
node:httpserver and request it. - Compile and run with Perry.
The clean source graph contains 111 compiled modules. No partial-codegen flag or internal package import is used.
Expected
The request completes and exposes the local server response, as under Node.
Actual
The executable throws while reading .length from an undefined value before the request completes.
Corrected provenance
The initial version of this issue reported undefined reference to js_webassembly_module_new. A coherent current-main build with Cargo available to Perry's auto-provisioning path correctly detects WebAssembly, builds perry-wasm-host, enables perry-runtime/wasm-host, and links successfully. That linker error came from the earlier build environment/artifact set and is not reproducible. After linking coherently, the runtime failure above reproduces.
Split from #10797 so undici can be tracked independently.
Activity
[-]undici: llhttp WebAssembly dependency fails to link js_webassembly_module_new[/-][+]undici: public request crashes reading length from undefined after llhttp loads[/+]proggeramlug commentedon Sep 21, 2026
Root cause localized and fixed:
PoolBase's computed instance-field keys were being remapped from their class-definition scope to synthetic constructor capture parameters. Those parameters are unbound when theStaticFieldSetkey snapshots run, so[kClients] = []was installed under the wrong key andPoollater failed atthis[kClients].length(pool.js:101).With the fix applied, that site is gone. The public fixture advances into the HTTP/1 parser and exposes a separate stream-contract failure at
client-h1.js:323:Socket.read()returnsundefinedinstead of thenullsentinel undici checks. That next blocker is tracked in #10908.fix(hir): preserve computed field key scope (#10889)
proggeramlug commentedon Sep 21, 2026
Fixed in v0.5.1633 (merge train 253,
0fa3915293) by #10909 —fix(hir): preserve computed field key scope. The undici crash was not in llhttp itself: computed instance-field keys in nested and CommonJS-wrapped classes were rewritten to unbound constructor-capture parameters, so undici's symbol-keyed pool state never initialised under the symbols its request path reads. Verified by runninga_computed_instance_field_key_is_not_a_constructor_capture(passes), and the fullperry-hirsuite is 471/0.