bun
bun copied to clipboard
`stream/promises` `finished` function does not work
What version of Bun is running?
1.1.1
What platform is your computer?
Darwin 23.4.0 arm64 arm
What steps can reproduce the bug?
- Clone repo
- Open folder
- Run
bun run prepare.js - See if file
dprintordprint.exeappears (notdprint.zip) after script finished
What is the expected behavior?
Script finishing and dprint or dprint.exe (on Windows) should appear.
You can test by running node prepare.js.
What do you see instead?
Script not finishing and appears only first step of script until finished part. I see only dprint.zip file
Additional information
No response
It also could be that Readable.fromWeb, specifically, is not emitting the event.
const response = await fetch(asset.browser_download_url);
const {body: bodyStream, status, ok} = response;
if (!ok || status !== 200) {
console.error({
status,
body: await response.text()
});
process.exit(1);
return false;
}
await finished(Readable.fromWeb(bodyStream).pipe(createWriteStream(localURL + extension)));
Related: #10066