Unable to use @aws-sdk/client-s3 in Nuxt 3 Pages

I have a new Nuxt 3.6.1 application deployed with cloudflare-pages and everything works as expected.
When using @aws-sdk/client-s3 and creating a new s3client the deployment to cloudflare-pages fails after the build and upload is already completed:

✨ Upload complete! Success: Assets published! Error: Failed to publish your Function. Got error: Uncaught TypeError: Cannot convert object to primitive value at functionsWorker-0.18438961492783257.js:20415:77 in e2.defaultUserAgent at functionsWorker-0.18438961492783257.js:22815:340 in Ry.getRuntimeConfig at functionsWorker-0.18438961492783257.js:22820:44 in S3Client at functionsWorker-0.18438961492783257.js:30336:1

Building the application on my local machine works. I also made sure to use the same nitro preset and node version 18.17.0
Was this page helpful?