diff --git a/surfsense_web/components/sources/DocumentUploadTab.tsx b/surfsense_web/components/sources/DocumentUploadTab.tsx index f1c81bbfb..30db47801 100644 --- a/surfsense_web/components/sources/DocumentUploadTab.tsx +++ b/surfsense_web/components/sources/DocumentUploadTab.tsx @@ -148,7 +148,10 @@ export function DocumentUploadTab({ const onDrop = useCallback( (acceptedFiles: File[]) => { setFiles((prev) => { - const newEntries = acceptedFiles.map((f) => ({ id: crypto.randomUUID(), file: f })); + const newEntries = acceptedFiles.map((f) => ({ + id: crypto.randomUUID?.() ?? `file-${Date.now()}-${Math.random().toString(36)}`, + file: f, + })); const newFiles = [...prev, ...newEntries]; if (newFiles.length > MAX_FILES) {