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

append() fails after upgrading from v6 to v7 #742

Closed
soulchild opened this issue Mar 6, 2024 · 4 comments
Closed

append() fails after upgrading from v6 to v7 #742

soulchild opened this issue Mar 6, 2024 · 4 comments

Comments

@soulchild
Copy link

Since upgrading from archiver@6 to archiver@7, my application fails with the following error:

ArchiverError: input source must be valid Stream or Buffer instance

I'm basically creating a zip of zips. Here's a minimal reproduction of the issue:

import archiver from 'archiver';
import { randomUUID } from 'node:crypto';

const createZip = (files) => {
  const archive = archiver('zip');
  for (const file of files) {
    archive.append(file, { name: randomUUID() });
  }
  archive.finalize();
  return archive;
};

const zip = createZip(['foobar']);
createZip([zip]);

I don't see anything listed in the CHANGELOG about there being a breaking change, so maybe one of the upgraded transient dependencies is the culprit?

Thanks for any hints!

@ctalkington
Copy link
Member

the major change was node 12 support dropped across archiver repos which did include version bumps of dependencies like readable-stream.

I know we have tests for appending streams but not sure I've tried to pass archiver stream in this way.

@ctalkington
Copy link
Member

ctalkington commented Mar 9, 2024

it does look like archiver-utils has stream detection issues with newer readable-stream v4 as shown with a failing test here:

archiverjs/archiver-utils#149

@ctalkington
Copy link
Member

should be resolved (additional test added across repos) in next point release

@soulchild
Copy link
Author

Awesome, @ctalkington! Thanks for the quick fix. I'll let you know if there's still a problem after upgrading to the next release.

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