Skip to content

get-stream does not complete when the stream has already ended #50

Closed
@ehmicky

Description

@ehmicky
import { Readable } from 'node:stream'
import { setTimeout } from 'node:timers/promises'
import getStream from 'get-stream'

const stream = Readable.from([])
stream.read()
await setTimeout(0)
await getStream(stream)
console.log('done')

With Node >=18.14.0 and >=19.5.0, done is not printed.
With Node <18.4.0 and <19.5.0, done is printed.

In other words, get-stream never completes when the stream has already ended.

This seems to be a bug with Node.js: nodejs/node#46595

This is related to the following line in get-stream:

await streamPipelinePromisified(inputStream, stream);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions