Skip to content

Commit 2bc2cb6

Browse files
fix(client): fix TypeError with undefined File (#28)
1 parent c5d034a commit 2bc2cb6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/internal/uploads.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ export const createForm = async <T = Record<string, unknown>>(
128128

129129
// We check for Blob not File because Bun.File doesn't inherit from File,
130130
// but they both inherit from Blob and have a `name` property at runtime.
131-
const isNamedBlob = (value: object) => value instanceof File || (value instanceof Blob && 'name' in value);
131+
const isNamedBlob = (value: object) =>
132+
(File && value instanceof File) || (value instanceof Blob && 'name' in value);
132133

133134
const isUploadable = (value: unknown) =>
134135
typeof value === 'object' &&

0 commit comments

Comments
 (0)