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

Failed to bundle @smithy/hash-blob-browser using Rollup v2.79.1 #18560

Open
3 tasks done
suryavaddiraju opened this issue Apr 6, 2024 · 0 comments
Open
3 tasks done

Comments

@suryavaddiraju
Copy link

Description

This is a dependency module for @aws-sdk/client-s3 while importing in the browser through cdn links I got an error in browser

Error in Browser

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

Also the output when importing the pacvkage is

/**
 * Failed to bundle using Rollup v2.79.1: failed to resolve an internal import.
 * If you believe this to be an issue with jsDelivr, and not with the package itself, please open an issue at https://github.com/jsdelivr/jsdelivr
 */

 throw new Error('Failed to bundle using Rollup v2.79.1: failed to resolve an internal import. If you believe this to be an issue with jsDelivr, and not with the package itself, please open an issue at https://github.com/jsdelivr/jsdelivr');

Expected Output we need when we import @smithy/hash-blob-browser

import { blobReader } from "@smithy/chunked-blob-reader";
export const blobHasher = async function blobHasher(hashCtor, blob) {
    const hash = new hashCtor();
    await blobReader(blob, (chunk) => {
        hash.update(chunk);
    });
    return hash.digest();
};

Affected jsDelivr links

https://cdn.jsdelivr.net/npm/@smithy/hash-blob-browser@2.2.0/+esm

Response headers

Accept-Ranges : bytes
Access-Control-Allow-Origin : *
Access-Control-Expose-Headers : *
Age : 776821
Alt-Svc : h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400
Cache-Control : public, max-age=31536000, s-maxage=31536000, immutable
Content-Encoding : br
Content-Length : 194
Content-Type : application/javascript; charset=utf-8
Cross-Origin-Resource-Policy : cross-origin
Date : Fri, 05 Apr 2024 13:08:26 GMT
Etag : W/"1dd-dwHmG+Y5W1orLGVsaAI8u0iySyc"
Timing-Allow-Origin : *
Vary : Accept-Encoding
X-Cache : HIT, HIT
X-Content-Type-Options : nosniff
X-Jsd-Version : 2.2.0
X-Jsd-Version-Type : version
X-Served-By : cache-fra-etou8220072-FRA, cache-maa10225-MAA

Information

  • Windows 10
  • Browser & Version: Version 123.0.6312.106 (Official Build) (64-bit)
  • VPN provider : None
  • Your location : IN

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

Already raised the issue with @AWS-SDK team and they concluded that the issue is with jsdeliver packing style
The issue can be tracked from this below link
aws/aws-sdk-js-v3#5969 (comment)

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

1 participant