-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed as duplicate of#8365
Closed as duplicate of#8365
Copy link
Labels
Description
What version of Bun is running?
1.2.3+8c4d3ff80
What platform is your computer?
Microsoft Windows NT 10.0.22631.0 x64
What steps can reproduce the bug?
- Run an external CLI with Bun Shell that takes several seconds to run and ultimately returns a process exit code of 1 or higher.
- Use
lines()to consume the shell as anAsyncIterable - Use
async_iterable[Symbol.asyncIterator]().next().then((line) => console.log('This should run, but never does:\n', line.value)).catch((err) => console.log('This shouldn\'t run on the first.nextcall, but does and contains the entire output', err.stdout.toString()))to demonstrate how many lines are being processed at a time.
What is the expected behavior?
Receive the first line of the CLI immediately as it is printed, never receive the error.
What do you see instead?
The entire CLI output (multiple seconds of runtime) is consumed by the one and only next() call, throwing an error with the entire stdout.
Additional information
Example implementation: https://github.com/MulverineX/extension-typescript-template/blob/f0a4c0c69a4410c00aa35e85b389dc583e8bfa5d/scripts/test.ts#L61
Reactions are currently unavailable
