From 5fe0a8a96ec9bc003008c038bfe856b186878817 Mon Sep 17 00:00:00 2001 From: Giancarmine Salucci Date: Sun, 21 Dec 2025 05:19:45 +0100 Subject: [PATCH] fix(tandoor): convert Buffer to Uint8Array for Blob compatibility TypeScript compiler error fixed: Buffer is not assignable to BlobPart. Convert Buffer to Uint8Array before creating Blob. --- src/lib/server/tandoor.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/server/tandoor.ts b/src/lib/server/tandoor.ts index 9ef7118..6a4109d 100644 --- a/src/lib/server/tandoor.ts +++ b/src/lib/server/tandoor.ts @@ -449,7 +449,9 @@ export async function uploadRecipeImage( const filename = `recipe-image${extension}`; // In Node.js, we must create a File from Blob (Blob alone doesn't work) - const blob = new Blob([buffer], { type: mimeType }); + // Convert Buffer to Uint8Array for compatibility + const uint8Array = new Uint8Array(buffer); + const blob = new Blob([uint8Array], { type: mimeType }); const file = new File([blob], filename, { type: mimeType }); console.log(`[Tandoor Upload] Created File: ${filename} (${file.size} bytes, ${file.type})`);