import { S3Client } from "@aws-sdk/client-s3";
const s3Client = new S3Client({
region: "auto",
endpoint: `https://${ACCOUNT_ID}.r2.cloudflarestorage.com`,
credentials: { accessKeyId, secretAccessKey},
})
Describe the bug
If you try to initialize the S3 sdk in cloudflare workers it fails with Cannot convert object to primitive value.
After investigating with the r2 team we reached this conclusion:
It appears that Nuxt is using unenv to smooth over differences in runtimes
And one of the things it does on build is replace imports from os with a proxy that doesn't appear to be working correctly
Additional context
S3 expects varables to be string, unenv is not passing them as string
Environment
cloudflare workers
Reproduction
Describe the bug
If you try to initialize the S3 sdk in cloudflare workers it fails with
Cannot convert object to primitive value
.After investigating with the r2 team we reached this conclusion:
Additional context
S3 expects varables to be string, unenv is not passing them as string
Logs
No response