Nuxt + AWS SDK + TS transpilation issue

I am using AWS JS SDK to get stuff from S3 via server on an API call. Using the client send method produces a [nuxt] [request error] [unhandled] [500] t is not a function. The reason I believe this to be a Cloudflare issue is because creating the application locally via nuxt build and nuxt preview does not produce the same issue. However, whenever I use wrangler or deploy to pages, the error occurs. The trouble code;
const command = new GetObjectCommand({
Bucket: "mybucket",
Key: "some-key"
})
console.log('sending')
const response = await client.send(command) // <--- Object.defineProperty called on non-object
console.log('response received') // <--- Not reached because of ^
const command = new GetObjectCommand({
Bucket: "mybucket",
Key: "some-key"
})
console.log('sending')
const response = await client.send(command) // <--- Object.defineProperty called on non-object
console.log('response received') // <--- Not reached because of ^
1 Reply
BigBallard
BigBallardOP3d ago
AWS SDK I learned is not compatable because of some libraries using @smithy dependency which in turn uses node:fs which based on this discussion makes it a no go. Gonna have to migrate to another solution
GitHub
t is not a function - when I use @aws-sdk/client-s3 on a Cloudfla...
I am pretty lost as I am not understanding where this error is coming from, I am able to get this working my S3 service working on a usual node runtime, but I just get this error t is not a functio...

Did you find this page helpful?