aws-sdk-js-v3: @aws-crypto/sha256-browser missing @aws-sdk/util-utf8-browser as a dependency in package.json

Describe the bug

[Package Error] “@aws-sdk/util-utf8-browser” no dependency version info found. (Imported by “@aws-crypto/sha256-browser”).

The package “@aws-crypto/sha256-browser” depends on “@aws-sdk/util-utf8-browser” as a dependency, but did not list any dependency version info in its package manifest. Without this information, the CDN is unable to properly resolve this import.

How to fix: Let the “@aws-crypto/sha256-browser” package author know that “@aws-sdk/util-utf8-browser” needs to be included in their package.json manifest

Your environment

SDK version number

@aws-sdk/client-kms@v3.33.0

Is the issue in the browser/Node.js/ReactNative?

Deno (via skypack.dev)

Details of the browser/Node.js/ReactNative version

deno v1.14.0

Steps to reproduce

Please share code or minimal repo, and steps to reproduce the behavior.

import { KMSClient, GetPublicKeyCommand, SignCommand } from "https://cdn.skypack.dev/@aws-sdk/client-kms?dts";

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 16

Most upvoted comments

Also worth noting that various other AWS SDKs are broken generally on (e.g.) Skypack until this change flows back to them. I tested a somewhat random sampling of @aws-sdk/client-ec2, @aws-sdk/client-ecs, @aws-sdk/client-cloudwatch-logs, and all were broken as of just now.

As before, always happy to help, just let me know what I can do. Among other things I’d be happy to help work on tests to make sure this doesn’t happen again.

Thanks @josecorella, I will only be able to verify this works when @aws-sdk/client-kms upgrades its crypto dependencies to 2.0.0 – unfortunately aws-sdk-js-v3 on main branch hasn’t updated yet: https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-kms/package.json#L22-L23

and therefore we are still seeing problems with both skypack:

error: Uncaught Error: [Package Error] “@aws-sdk/util-utf8-browser” no dependency version info found. (Imported by “@aws-crypto/sha256-browser”). throw new Error(“[Package Error] "@aws-sdk/util-utf8-browser" no dependency version info found. (Imported by "@aws-crypto/sha256-browser").”); ^ at https://cdn.skypack.dev/error/unknown:@aws-sdk/util-utf8-browser?from=@aws-crypto/sha256-browser:13:7

and esm.sh:

Uncaught SyntaxError: The requested module ‘/v54/@aws-crypto/sha256-browser@1.2.2/deno/sha256-browser.js’ does not provide an export named ‘Sha256’

Obviously aws-sdk-js-crypto-helpers@2.0.0 was released just a few hours ago, but do you know how long it will take to incorporate these latest dependencies here into v3?

EDIT

I was able to test the 2.0.0 dependencies with esm.sh through the specify external dependencies feature:

"@aws-sdk/client-kms": "https://esm.sh/@aws-sdk/client-kms?deps=@aws-crypto/sha256-browser@2.0.0,@aws-crypto/sha256-js@2.0.0"

however, the same error occurred:

The requested module ‘/v54/@aws-crypto/sha256-browser@2.0.0/deno/sha256-browser.js’ does not provide an export named ‘Sha256’

This affects a wide number of people using this from CDNs like skypack—Deno, people import’ing from browser, etc. Can we please prioritize fixing this? Happy to jump in if that’s helpful.