From 2d3939cc1c194a55d3811459f76a9d54dc337447 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Mar 2025 10:44:09 +0000 Subject: [PATCH] fix(client): fix TypeError with undefined File --- src/internal/uploads.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/internal/uploads.ts b/src/internal/uploads.ts index 54431c1..e09bcbb 100644 --- a/src/internal/uploads.ts +++ b/src/internal/uploads.ts @@ -128,7 +128,8 @@ export const createForm = async >( // We check for Blob not File because Bun.File doesn't inherit from File, // but they both inherit from Blob and have a `name` property at runtime. -const isNamedBlob = (value: object) => value instanceof File || (value instanceof Blob && 'name' in value); +const isNamedBlob = (value: object) => + (File && value instanceof File) || (value instanceof Blob && 'name' in value); const isUploadable = (value: unknown) => typeof value === 'object' &&