Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ehmicky opened this issue Feb 10, 2023 · 1 comment
Closed

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

ehmicky opened this issue Feb 10, 2023 · 1 comment

Comments

@ehmicky
Copy link
Collaborator

ehmicky commented Feb 10, 2023

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);

@ehmicky
Copy link
Collaborator Author

ehmicky commented Aug 6, 2023

This was fixed by Node 19.8.0.

@ehmicky ehmicky closed this as completed Aug 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant