diff --git a/src/platforms/storage/index.ts b/src/platforms/storage/index.ts index b11d8e43..59dab5cc 100644 --- a/src/platforms/storage/index.ts +++ b/src/platforms/storage/index.ts @@ -160,12 +160,15 @@ export const uploadFileFromClient = async ( try { return await uploadFromClientViaPresignedUrl(file, fileName); } catch (error) { - // Fall back to Vercel Blob when configured, so uploads stay available - // even if third-party object storage is temporarily unreachable. - if (HAS_VERCEL_BLOB_STORAGE) { - return vercelBlobUploadFromClient(file, fileName); + // HAS_VERCEL_BLOB_STORAGE relies on BLOB_READ_WRITE_TOKEN which is a + // server-only variable (not NEXT_PUBLIC_*), so it is always false in + // the browser. vercelBlobUploadFromClient only needs the server-side + // token via handleUploadUrl, so try it unconditionally as a fallback. + try { + return await vercelBlobUploadFromClient(file, fileName); + } catch { + throw error; } - throw error; } }