-
Notifications
You must be signed in to change notification settings - Fork 116
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
uncaught FILE_ENDED error #75
Comments
I think this should be fixed now - please reopen if issue persists |
Hey guys! i'm not sure if this issue is back? But i was using
and gave gave me this error:
(However the files extracted okay without problem!) |
@lucidkodo You might want to try async await and do one file at a time and see if it makes a difference, or at the very least spot the offending file. async function extract() {
for (let i = 0; i < files.length; i++) {
console.log(files[i]);
await fs.createReadStream(files[i])
.pipe(zipper.Extract({path: 'path/to/dest'}))
.on('error',console.log)
.on('finish', () => console.log('finised')
.promise()
}
} Or you could use the async function extract() {
for (let i = 0; i < files.length; i++) {
console.log(files[i]);
const directory = await zipper.Open.file(files[i]);
await directory.extract({'path/to/dest'})
}
} |
@ZJONSSON thank you so much for your prompt reply! I'm using the first suggested approach as i need to do some extra processing once the file is done unzipping. thanks again! |
@ZJONSSON I'm experiencing the same file_ended issues when using the |
@jlommori Can you confirm you are using the latest version of |
@ZJONSSON Of course as I extract the code to post here and test it, everything works when the section isolated from everything else. So I guess I have some additional troubleshooting to do within the whole program. Thank you for the willingness to assist! |
I think this is the same as #48 - I've opened a new issue as that was closed and changes have been made since then...!
After finding this out when moving over to the Open APIs (#74) I've been looking into it and found that it's caused by the following line:
node-unzipper/lib/PullStream.js
Line 66 in 835c041
Is this supposed to be emitting on
p
- the returned PassThrough stream instead?I've been playing around with a fix here which instead emits the error to the returned stream instead.
I've also had to include a similar fix as #57 (nulling out
self.cb
) and these changes fix the uncaught error and its propagated up to the Promise retuned fromunzipper.Open.file
but it breaks theparseOneEntry.js: error - file ended
test case and I'm not sure why :-/I hope this helps you debug it a bit! It might be the case that after the bug in the fix for #57 is implemented (#71) everything might work without this anyway...
The text was updated successfully, but these errors were encountered: