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

Unexpected EOF when inflating ZIP #208

Open
blacha opened this issue Feb 12, 2024 · 6 comments
Open

Unexpected EOF when inflating ZIP #208

blacha opened this issue Feb 12, 2024 · 6 comments

Comments

@blacha
Copy link

blacha commented Feb 12, 2024

The problem

I have a zip file that I can decompress with other decompressors (ubuntu's unzip, yazul, python3) but when using fflate the zip is unable to be decompressed.

Error: unexpected EOF
    at inflt ([worker eval]:233:25)
    at Inflate.c ([worker eval]:289:18)
    at Inflate.push ([worker eval]:294:29)
    at [worker eval]:263:40
    at MessagePort.<anonymous> ([worker eval]:298:86)

How to reproduce

Using a simple script

import { AsyncUnzipInflate, Unzip } from 'fflate';

const bytes = readFileSync('./address.zip'); 
const unzip = new Unzip((file) => {
  console.log(file.name);
  file.ondata = (err, data, final) => {
    if (err) throw err;
    console.log('got', file.name, data.length, final);
  };
  file.start();
});

unzip.register(AsyncUnzipInflate);
unzip.push(bytes);

with my sample zip file: https://public.chard.com/fflate/address.zip

@101arrowz
Copy link
Owner

I'll look into this and let you know what the issue is soon. The streaming unzip API has needed a bit of work for a while now...

@dwsilk
Copy link

dwsilk commented Mar 5, 2024

Still unsure of the issue here @101arrowz?

@101arrowz
Copy link
Owner

Sorry, I've been busy for the last few weeks - I probably won't be able to get to this for a while. To be honest I would just advise against using the streaming unzip API until I can get around to fixing it.

@johan-tribus
Copy link

Hi @101arrowz,

I'm encountering the same problem with this file: https://github.com/johan-tribus/fflate/blob/master/file.zip
Have you had a chance to investigate the issue yet?

@SvV-CWinJS
Copy link

Hi 101arrowz

Thank you for this great tool.

I have the same problem, using unzipSync.
Strangely, though, I remember seeing it work on the same file several weeks ago.
This makes me think it is perhaps a certain race condition that mostly does not work out (or worse: a Windows update :D).

I hope you find and solve the problem easily.

@khoa-superfine
Copy link

Hi @101arrowz

Thank you for this great tool.

I had the same problem when using decompressSync.
Strangely enough. it works with a downloaded zip file. but after i unzip it then compress on mac. I get error: Unexpected EOF. I have compressed files before and used decompressSync and it worked fine.

I hope you find and solve the problem easily.

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

6 participants