-
Notifications
You must be signed in to change notification settings - Fork 117
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
Build fails without @aws-sdk/client-s3 package in package.json #330
Comments
@MaksimDedov plus one facing the same issue. |
same here |
To keep node-unzipper super small, a decision was made to not include optional third party sdks as a part of the library itself. unzipper has plenty of users that do not require the s3 features and it would be very inefficient to force them to do so (example: https://www.npmjs.com/package/exceljs) If you want to use the aws_s3 you will have to ensure that the sdk is installed, i.e. |
@MaksimDedov can you confirm the build error only occurs because you are actually use the aws_v3 in the build process? |
@ZJONSSON In my code I use unzipper in the next way and only once:
I don't call any other functions. The The build error occurs if I don't add the |
Thank that is very helpful. This seems to be a typescript/ts-loader compilation error not a runtime error. Seems like the appropriate fix here is a simple @ts-ignore. |
@MaksimDedov can you try with [email protected] that was just published? |
unfortunately I see the same issue for [email protected]:
|
Same error on my side ^^"
Stack trace from Next:
And the only thing I'm doing with const bytes = await jar.arrayBuffer(); // where jar is a File
const buffer = Buffer.from(bytes);
const archive = await unzipper.Open.buffer(buffer); |
Similar issue when using
Temporary workaround: Add client-s3 to
|
I'm getting this error in my vue app My Code const directory = await Unzipper.Open.buffer(newFile) Terminal Error
UPDATE 1
Is Unzipper not designed to work within a non-server environment or something? If it's any help, I'm using UPDATE 2 This package does look really nice though! |
@ZJONSSON |
This is a bundling issue. Bundler can't tell at build time whether the dependency will be used or not, so tries to bundle it but it's not installed. For those using Nextjs (or a webpack based framework), something like the following will work as an alternative to installing the dependency: const nextConfig: NextConfig = {
webpack: (config) => {
config.resolve.alias = {
...config.resolve.alias,
"@aws-sdk/client-s3": false,
};
} |
@ZJONSSON how about having different entry points for this? Something like: import { Open } from `unzipper/s3` I think you can do this within the one package by splitting out the code and modifying your
Alternatively listing PS: great package, thanks for shipping! ❤️ |
I am also facing the problem
|
Hey!
When I install the
unzipper
npm package and don't install separately@aws-sdk/client-s3
I get the build exception like below.Please move
@aws-sdk/client-s3
to required dependencies for automatic installation, or fix it usage.Thanks in advance
The text was updated successfully, but these errors were encountered: