Skip to content

stream: Duplex.from errors when async function body resolves without consuming its input #66349

Description

@kethinov

Version

26.10.0

Platform

All

Subsystem

No response

What steps will reproduce the bug?

The bug, as of node 26.10.0:

node -v
v26.10.0
node -e "require('node:stream').Duplex.from(async () => {})"
node:events:505
    throw er; // Unhandled 'error' event
    ^

AbortError: The operation was aborted
    at destroyer (node:internal/streams/destroy:328:11)
    at node:internal/streams/duplexify:120:13
Emitted 'error' event on Duplexify instance at:
    at emitErrorNT (node:internal/streams/destroy:170:8)
    at emitErrorCloseNT (node:internal/streams/destroy:129:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
  code: 'ABORT_ERR'
}

Node.js v26.10.0

How often does it reproduce? Is there a required condition?

Always.

What is the expected behavior? Why is that the expected behavior?

The original behavior, as of node 26.9.0:

node -v
v26.9.0
node -e "require('node:stream').Duplex.from(async () => {})"
// no output; this is expected

What do you see instead?

The above error.

Additional information

0bf9e9f833 (#65963) introduced a regression. It destroys the duplex when an async function body resolves without consuming its input, so that pipeline() propagates destruction upstream. It destroys it through destroyer(), which synthesizes an AbortError for any stream that is not yet finished.

This bug breaks anything that uses p-transform (yeoman-environment and mem-fs).

PR fix here: #66243

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues and PRs for confirmed bugs.regressionIssues related to regressions.streamIssues and PRs related to Node.js streams.v26.xIssues that can be reproduced on v26.x or PRs targeting the v26.x-staging branch.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions