Skip to content

stream.pipeline does not correctly work with process.stdout and stderr #59648

@polomsky

Description

@polomsky

Version

24.6.0 22.18.0

Platform

Windows

Subsystem

No response

What steps will reproduce the bug?

Run in interactive mode (REPL)
stream.pipeline(fs.createReadStream('c:\\testfile.txt'), process.stdout)

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

always

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

Expected behavior is that content of the file will be printed to STDOUT.

What do you see instead?

TypeError [ERR_INVALID_ARG_TYPE]: The "streams[stream.length - 1]" property must be of type function. Received an instance of WriteStream

Additional information

process.stdout is Stream, based on documentation of stream.pipeline destination is allowed to be Stream.

Metadata

Metadata

Assignees

No one assigned

    Labels

    streamIssues and PRs related to the stream subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions