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

Specific uscase error: empty dir in zip archive #107

Open
vladblindu opened this issue Jan 7, 2024 · 1 comment
Open

Specific uscase error: empty dir in zip archive #107

vladblindu opened this issue Jan 7, 2024 · 1 comment

Comments

@vladblindu
Copy link

vladblindu commented Jan 7, 2024

Hi there,

This is not an issue but more of a specific usecase fix.

I encountered an error (ENOENT) when the a zip file contains an empty dir. The problem might be generated by the zipping utility, because the type field id set to file instead of dir.

Changing this line to:

if (x.type === 'directory' || x.path.endsWith('/')) {

solves the problem.

It looks like nobody else had this issue so I'm posting it this just in case someone, in the future might have the same problem as I did. My specific use case is related to the unzipping of a Writerside created archive. There is an empty resources folder (probably is only empty in this specific situation) that is included in the archive but errors on extraction.

Thank you all for your time and effort.

@vladblindu vladblindu changed the title Empty dir in zip folder error Specific uscase empty dir in zip archive error Jan 7, 2024
@vladblindu vladblindu changed the title Specific uscase empty dir in zip archive error Specific uscase error: empty dir in zip archive Jan 7, 2024
@benfosterlitmos
Copy link

I ran into the same issue. Thanks for the tip @vladblindu - applying your fix using patch-package has solved the problem for me too.

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

2 participants