evanw / esbuild

An extremely fast bundler for the web
https://esbuild.github.io/
MIT License
37.92k stars 1.13k forks source link

@aws-sdk/lib-storage File Upload is not working at esbuild@0.19.3 #3893

Open eXpertise7 opened 3 weeks ago

eXpertise7 commented 3 weeks ago

The previous version in which this bug was not present was Before migrating to the esbuild system. This feature works with webpack builder.

Description I am trying to upload images to AWS but because of the Migrating to the new build system it is not working anymore.

Minimal Reproduction

import { Upload } from "@aws-sdk/lib-storage";
import { S3Client } from "@aws-sdk/client-s3";

  const parallelUploads3 = new Upload({
    client:  new S3Client({}),
    params: { Bucket, Key, Body },
  });
  parallelUploads3.on("httpUploadProgress", (progress) => {
    console.log(progress);
  });

parallelUploads3.done() .then(
                (data) => {
                   console.log(data)
                },
                (err: any) => {
                    console.log(err)
                },
            );
Exception or Error
TypeError: Cannot read properties of undefined (reading 'done')
    at getChunkStream.js:5:5
    at Generator.next (<anonymous>)
    at resume (chunk-CDW57LCT.js?v=b9e9dd30:100:27)
    at chunk-CDW57LCT.js?v=b9e9dd30:106:63
    at new ZoneAwarePromise (zone.js:1425:21)
    at it.<computed> [as next] (chunk-CDW57LCT.js?v=b9e9dd30:106:38)
    at Upload.<anonymous> (Upload.js:130:9)
    at Generator.next (<anonymous>)
    at chunk-CDW57LCT.js?v=b9e9dd30:90:61
    at new ZoneAwarePromise (zone.js:1425:21)

Source error preview:

image

Environment

Angular CLI: 17.3.8 Node: 18.13.0 Package Manager: npm 8.19.4 OS: darwin x64

Angular: 17.3.10 ... animations, cdk, common, compiler, compiler-cli, core, forms ... material, material-moment-adapter, platform-browser ... platform-browser-dynamic, router

Package Version

"dependencies": {
"@angular/animations": "17.3.0",
"@angular/cdk": "17.2.2",
"@angular/common": "17.3.0",
"@angular/compiler": "17.3.0",
"@angular/core": "17.3.0",
"@angular/forms": "17.3.0",
"@angular/platform-browser": "17.3.0",
"@angular/platform-browser-dynamic": "17.3.0",
"@angular/router": "17.3.0",
"@aws-sdk/abort-controller": "^3.127.0",
"@aws-sdk/client-cognito-identity": "^3.150.0",
"@aws-sdk/client-s3": "^3.150.0",
"@aws-sdk/client-sts": "^3.150.0",
"@aws-sdk/lib-storage": "^3.150.0",
"typescript": "5.2.2"
"zone.js": "0.14.6",
...
},
devDependencies: {
"@angular-devkit/build-angular": "17.3.0",
"@angular-eslint/builder": "17.3.0",
"@angular-eslint/eslint-plugin": "17.3.0",
"@angular-eslint/eslint-plugin-template": "17.3.0",
"@angular-eslint/schematics": "17.3.0",
"@angular-eslint/template-parser": "16.1.1",
"@angular/cli": "17.3.0",
"@angular/compiler-cli": "17.3.0",
"@angular/language-service": "17.3.0",
"@aws-sdk/types": "^3.215.0",
"typescript": "5.2.2",
...
}

Helpful link can be found here: https://github.com/angular/angular-cli/issues/27771#issuecomment-2304376589.

eXpertise7 commented 3 weeks ago

@evanw If any further details are needed, I'm available to explain.