-
Notifications
You must be signed in to change notification settings - Fork 114
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
stream.pipeline [ERR_STREAM_PREMATURE_CLOSE]: Premature close #228
Comments
Any solutions to this? I'm facing the same error here: await pipeline(
createReadStream('./sample.zip'),
Parse({ forceStream: true }),
async function processZip(entries: AsyncIterable<Entry>) {
for await (const entry of entries) {
const { path, type } = entry;
console.log(path, type);
await entry.autodrain();
}
return true;
}
); Gives me Node version v14.17.0 |
I get this error as well, having upgraded from Node 16 to Node 17 |
Same error on our side after update :( |
any update on this @ZJONSSON ? |
This error looks like a misuse of the stream API in the first place, that is now more severely reported by Node since v17+. Maybe @mcollina and @ronag (nodejs core members) can give a hand here? I'd gladly provide my assistance with a repro project, but unfortunately I don't know enough about streams to provide a full PR... :-( |
I am also now facing this issue. This was not an issue on Node v12.. but we recently upgraded to Node v18 and I'm receiving this error. I'm not able to find a workaround. EDIT: Found a workaround: stream
.pipe(unzipper.Parse())
.on('entry', function (entry) {
const fileName: string = entry.path;
const type = entry.type; // 'Directory' or 'File'
if (type === 'File')) {
// do some stuff
} else {
entry.autodrain();
}
})
.promise(); Seems like maybe it's just an issue with the |
👋
|
Is this a problem in Node 19 as well? |
I'm also facing this issue on Node 18, as mentioned above, it seems to be an issue with |
Can confirm that @wolfymaster's solution works for me too. |
Unfortunately I use an async/await-based batching algorithm right in the middle of that |
Will merge later today |
This PR has been published as a patch version #274 |
THANK you - and I apologize for my doubts! |
Hello. Could help me. I am using I am using stream.pipeline but I have an error [ERR_STREAM_PREMATURE_CLOSE]: Premature close. The file is unpacked, apparently the error occurs due to the fact that it happens with method destroy() instead of end().
stackoverflow
How do I fix this error? Thank you.
Ububtu 20.10 x64
Node.js 15.4.0
Error
The text was updated successfully, but these errors were encountered: