Skip to content

node:stream: classic stream objects missing on/write/pipe on some construction paths #3663

Description

@proggeramlug

Summary

Classic (Node) stream objects do not expose their EventEmitter / Writable methods
on some construction paths: calling .on(), .write(), or .pipe() throws
"TypeError: is not a function". A parity sweep shows 65 failures
with this signature, overwhelmingly in node:stream.

Evidence (from scripts/parity_gap_report.py, 2026-05-31)

65 failures. Categories: stream (49), zlib (5), async_hooks (3), string_decoder
(2), fs (2), events (2), http (1), crypto (1) — i.e. anything that hands back a
stream object.

Representative cases:

  • stream/test-stream-pipe-cleanup.json is not a function
  • stream/test-stream-pipe-event.json is not a function
  • stream/test-stream-pipeline.jspipe is not a function
  • stream/test-stream-duplex.jswrite is not a function
  • stream/test-stream2-writable.jswrite is not a function
  • stream/test-stream-readable-emittedReadable.json is not a function

The leak into zlib/crypto/fs/http suggests the missing methods are on a shared
stream base that some factory paths return without the EventEmitter/Writable
method surface wired up.

Repro

const { Readable } = require('stream');
const r = new Readable({ read() {} });
r.on('data', () => {});   // Perry: "on is not a function" on the affected path

Suggested scope

Ensure every stream object Perry returns (Readable/Writable/Duplex/Transform and
the wrappers zlib/crypto/fs/http hand out) carries the full EventEmitter
(on/once/emit/…) and Writable (write/end/pipe) method set. Likely a
prototype/dispatch wiring gap on one construction path rather than a missing
implementation.


Filed from the parity-gap radar. Cluster: 65 "on/write/pipe is not a function"
failures, concentrated in node:stream.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions