From c8950589b3b6b7c8e22da2ae28d3dd99fe1d2866 Mon Sep 17 00:00:00 2001 From: Mannu Date: Sun, 10 May 2026 14:37:34 +0530 Subject: [PATCH] More debug logging --- src/app/api/upload/route.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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)