-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Deno hangs during S3 bucket upload when deploying with AWS CDK #27239
Comments
FWIW, this behavior started for me at CDK v2.167.0. Perhaps the biggest change was the transition from using aws-sdk v2 to v3. |
I believe the issue indeed has to do with some interaction with the I've created a repo the reproduces the problem and demonstrates that using a prior version of |
@gdtroszak Thanks, your solution worked for me. |
While @gdtroszak 's solution works in some cases, it doesn't apply to all s3 APIs with some failing with
Eagerly awaiting #27381 to land. You folks know any other workaround? |
This still fails in Deno 2.1.4 but works in Node: import { PutObjectCommand, S3Client } from '@aws-sdk/client-s3'
const s3 = new S3Client({
...
})
const uploadObject = async () => {
try {
const command = new PutObjectCommand({
Bucket: BUCKET_NAME,
Key: OBJECT_KEY,
Body: OBJECT_CONTENT,
})
console.log('Uploading object...')
const response = await s3.send(command)
console.log('Upload successful:', response)
} catch (error) {
console.error('Error uploading object:', error)
}
}
uploadObject() I spent an entire day debugging this issue, and it turns out the problem lies with Deno. Unfortunately, this was the last thing I thought could be causing it. This fails without errors, which is the scariest part. |
Temporary fix for Deno 2.1.4: import { S3Client } from '@aws-sdk/client-s3'
import { NodeHttpHandler } from 'npm:@smithy/[email protected]' // DOWNGRADE HERE
const s3 = new S3Client({
requestHandler: new NodeHttpHandler(),
}) |
@taseenb what version of Edit: nvm. Looks like I was already using 3.3.1 when I encountered the |
3.726.1 works Later versions seem to have issues, but haven't tried again recently |
Version: Deno 2.1.2
AWS CDK: 2.171.1
When trying to deploy infrastructure using the
cdk deploy
command, the process hangs when uploading assets to the CDK deplloyment asset S3 bucket. This works fine if using Node.js.❯ cdk deploy
✨ Synthesis time: 0.4s
my-stack: start: Building 5dc4439c955fa5cef985fdc3a01dc6df93ad4777214f12b9027aba5873263b9f:nnnnnnnnnnnn-eu-west-1
my-stack: success: Built 5dc4439c955fa5cef985fdc3a01dc6df93ad4777214f12b9027aba5873263b9f:nnnnnnnnnnnn-eu-west-1
my-stack: start: Publishing 5dc4439c955fa5cef985fdc3a01dc6df93ad4777214f12b9027aba5873263b9f:nnnnnnnnnnnn-eu-west-1
(no progress from here...)
AWS CDK installed as global install:
deno install -g --name cdk npm:aws-cdk
cdk.json:
deno.json:
main.ts:
The text was updated successfully, but these errors were encountered: