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

zlib.crc32 error: isArrayBufferView is not defined #27774

Closed
tv2-kjetilwikestad opened this issue Jan 22, 2025 · 3 comments · Fixed by #27777
Closed

zlib.crc32 error: isArrayBufferView is not defined #27774

tv2-kjetilwikestad opened this issue Jan 22, 2025 · 3 comments · Fixed by #27777
Labels
bug Something isn't working correctly node compat

Comments

@tv2-kjetilwikestad
Copy link

tv2-kjetilwikestad commented Jan 22, 2025

Version: Deno 2.1.6

Get this error when using the aws-sdk and s3 bucket to download file with checksums.

Stacktrace:

error: Uncaught ReferenceError: isArrayBufferView is not defined
    at Object.crc32 (node:zlib:26:19)
    at NodeCrc32.update (file:///app/node_modules/.deno/@aws-sdk+middleware-flexible-checksums@3.732.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-cjs/getCrc32ChecksumAlgorithmFunction.js:11:30)
    at ChecksumStream._write (file:///app/node_modules/.deno/@smithy+util-stream@4.0.2/node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.js:25:27)
    at writeOrBuffer (ext:deno_node/_stream.mjs:3520:16)
    at _write (ext:deno_node/_stream.mjs:3465:14)
    at ChecksumStream.Writable.write (ext:deno_node/_stream.mjs:3468:14)
    at Transform.ondata (ext:deno_node/_stream.mjs:2744:26)
    at Transform.emit (ext:deno_node/_events.mjs:393:28)
    at Transform.Readable.read (ext:deno_node/_stream.mjs:2597:14)
    at flow (ext:deno_node/_stream.mjs:2933:38) 
@AlpriElse
Copy link

AlpriElse commented Jan 23, 2025

I ran into this and my workaround until Deno is released with this fix was using @aws-sdk/* dependencies v3.728 or older

Here's the @aws-sdk/* imports I'm using in my deno.json:

"imports": {
    "@aws-sdk/client-dynamodb": "npm:@aws-sdk/client-dynamodb@3.726.0",
    "@aws-sdk/client-s3": "npm:@aws-sdk/client-s3@3.726.0",
    "@aws-sdk/client-sqs": "npm:@aws-sdk/client-sqs@3.728.0",
    "@aws-sdk/s3-request-presigner": "npm:@aws-sdk/s3-request-presigner@3.726.0",
    "@aws-sdk/util-dynamodb": "npm:@aws-sdk/util-dynamodb@3.726.0",
   ...more
}

The aws-sdk-js-v3 had the following in their v3.729.0 release which seems related to this suddenly breaking:

middleware-flexible-checksums:
perform checksum calculation and validation by default (aws/aws-sdk-js-v3#6750) (f6068c83)
change default algorithm to CRC32 (aws/aws-sdk-js-v3#6749) (2293f5a8)

The only confirmation I have that this new release is the root cause is when running my project with v3.729.0 or newer has this error raised; running with deps v3.728.0 or older works as expected

@ry
Copy link
Member

ry commented Jan 23, 2025

by using deno upgrade --canary you can try out this fix now

@AlpriElse
Copy link

AlpriElse commented Jan 24, 2025

by using deno upgrade --canary you can try out this fix now

Confirmed that this bug is fixed with the canary Deno version, thank you folks 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly node compat
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants