Skip to content

'stream.push() after EOF' error when using Readable.fromWeb #42694

Closed
@kyrylkov

Description

@kyrylkov

Version

v18.0.0-rc.1

Platform

Microsoft Windows NT 10.0.22000.0 x64 / Linux 5.10.96-90.460.amzn2022.aarch64

Subsystem

Streams

What steps will reproduce the bug?

  1. Get a large file using fetch
  2. Convert body to readable stream with Readable.fromWeb
  3. Try to save the stream into a file
const { body } = await fetch(url);
const readable = Readable.fromWeb(body);
const filePath = path.join('file.txt');
await pipeline(
  readable,
  fs.createWriteStream(filePath, { flags: 'w' })
);

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

For some specific files

What is the expected behavior?

Save file to disk

What do you see instead?

stream.push() after EOF and incomplete file on disk

Additional information

No response

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