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

ESM modules @aws-crypto/sha1-browser and @aws-crypto/sha256-browser are missing exports #18536

Open
3 tasks done
mjgurney opened this issue Oct 18, 2023 · 2 comments
Open
3 tasks done

Comments

@mjgurney
Copy link

mjgurney commented Oct 18, 2023

Description

When importing @aws-sdk/client-s3 using the ESM flag from the latest version:

the module tries to import Sha1 from /npm/@aws-crypto/sha1-browser@3.0.0/+esm and Sha256 from /npm/@aws-crypto/sha256-browser@3.0.0/+esm.

An error results because those keys are not defined as exports of the corresponding jsdelivr CDN modules:

Only the latest version of these modules in the jsdelivr CDN (version 5.2.0) exports the expected keys.

Should @aws-sdk/client-s3 be rebundled to import @5.2.0/+esm versions of these two modules? Or perhaps the @3.0.0/+esm versions of these modules need to be rebundled to include the exports required by @aws-sdk/client-s3?

Affected jsDelivr links

https://cdn.jsdelivr.net/npm/@aws-sdk/client-s3@3.430.0/+esm

Response headers


Information

  • Device OS: MacOS
  • Browser & Version: Chrome, Safari, FireFox (all versions)
  • Location: Vancouver, Canada

Requisites

  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue.
  • I checked the documentation to understand that the issue I am reporting is not normal behavior.
  • I understand that not filling out this template correctly will lead to the issue being closed.

Additional content

No response

@MartinKolarik
Copy link
Member

Thanks for the report. I managed to improve the export detection so that Sha1 and Sha256 are now exported. The change isn't live yet but will be with the next deployment.

Unfortunately, after that, I found there's an issue with another module imported by https://cdn.jsdelivr.net/npm/@aws-sdk/client-s3@3.430.0/+esm as well. There, it's an incorrect use tslib which would I don't think we can/should fix. So even after the issue here is fixed, the client won't work in its current form.

@suryavaddiraju
Copy link

There is an another issue with import of @aws-sdk/client-s3 module where I am getting an error if I import through JS deliver cdn

https://cdn.jsdelivr.net/npm/@aws-sdk/client-s3@3.549.0/+esm

Error

Uncaught SyntaxError: The requested module '/npm/@smithy/hash-blob-browser@2.0.13/+esm' does not provide an export named 'blobHasher' (at jsdelivr-header.js:7:1)

Details of the browser/Node.js/ReactNative version
Chrome Version 123.0.6312.106 (Official Build) (64-bit) on Windows 10

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

4 participants
@MartinKolarik @mjgurney @suryavaddiraju and others