diff --git a/src/app/api/upload/route.ts b/src/app/api/upload/route.ts index 5075dc7..ee7e564 100644 --- a/src/app/api/upload/route.ts +++ b/src/app/api/upload/route.ts @@ -8,8 +8,11 @@ function getR2() { const secretKey = process.env.R2_SECRET_ACCESS_KEY; const bucket = process.env.R2_BUCKET_NAME; + // Debug: log what's available + console.log("R2 envs:", { accountId: !!accountId, accessKeyId: !!accessKeyId, secretKey: !!secretKey, bucket: !!bucket }); + if (!accountId || !accessKeyId || !secretKey || !bucket) { - throw new Error(`Missing R2 config`); + throw new Error(`Missing R2 config: accountId=${!!accountId}, accessKeyId=${!!accessKeyId}, secretKey=${!!secretKey}, bucket=${!!bucket}`); } // Use public development URL (from R2 bucket settings)