FlowiseAI/Flowise · error · Error
Error loading file
Error message
Error loading file
What it means
When MultiFileLoader has no registered factory for a file's extension, it falls back to TextLoader. If TextLoader.load() rejects, the original error is swallowed and replaced with the generic 'Error loading file' with no context about why. This makes diagnosis very hard.
Source
Thrown at packages/components/nodes/documentloaders/File/File.ts:384
if (Object.keys(loaders).length === 0) {
throw new Error('Must provide at least one loader')
}
}
public async load(): Promise<Document[]> {
const documents: Document[] = []
for (const fileBlob of this.fileBlobs) {
const loaderFactory = this.loaders[fileBlob.ext]
if (loaderFactory) {
const loader = loaderFactory(fileBlob.blob)
documents.push(...(await loader.load()))
} else {
const loader = new TextLoader(fileBlob.blob)
try {
documents.push(...(await loader.load()))
} catch (error) {
throw new Error(`Error loading file`)
}
}
}
return documents
}
}
module.exports = { nodeClass: File_DocumentLoaders }
View on GitHub (pinned to abe4a8601a)
Solutions
- Register a dedicated loader for the file's extension, or convert the file to a supported format before upload.
- Lowercase the extension when looking up the factory so '.PDF' matches a '.pdf' key.
- Improve the catch to preserve the cause: throw new Error(`Error loading file ${fileBlob.ext}: ${error.message}`, { cause: error }).
- Verify the Blob is non-empty before it reaches MultiFileLoader.
Example fix
// before
try {
documents.push(...(await loader.load()))
} catch (error) {
throw new Error(`Error loading file`)
}
// after - preserve cause and context
try {
documents.push(...(await loader.load()))
} catch (error) {
throw new Error(`Error loading .${fileBlob.ext} file: ${error instanceof Error ? error.message : String(error)}`, { cause: error })
} Defensive patterns
Strategy: try-catch
Validate before calling
function assertNonEmptyBlob(blob: Blob): void {
if (blob == null) throw new Error('File blob is null/undefined')
if (typeof blob.size === 'number' && blob.size === 0) throw new Error('File blob is empty (0 bytes)')
}
// for (const fb of fileBlobs) assertNonEmptyBlob(fb.blob) Try / catch
try {
documents.push(...(await loader.load()))
} catch (error) {
const reason = error instanceof Error ? error.message : String(error)
// original error is swallowed upstream; re-surface by inspecting blob.ext
throw new Error(`Failed to load .${fileBlob.ext} via TextLoader fallback: ${reason}`)
} Prevention
- Register a dedicated loader for the file's extension before upload.
- Lowercase extensions when looking up the factory (case mismatch triggers the TextLoader fallback).
- Reject empty blobs upstream so TextLoader never receives a 0-byte input.
When it happens
Trigger: A binary or non-text file (image, archive, encrypted PDF) reaches the fallback because no specific loader is registered for its extension; the Blob is empty or corrupt; encoding detection fails; the extension was upper-case and did not match a registered lower-case key.
Common situations: User uploads a .heic, .odt, or other unsupported extension that has no dedicated loader; a .pdf with a stripped/corrupt xref table that TextLoader cannot read; case-sensitive extension mismatch.
Related errors
- Could not find JSON block in the output.
- Failed to parse a valid scenario from the LLM's response. Pl
- Invalid JSON in the Chat NVIDIA NIM's baseOptions: ${excepti
- Failed to fetch ${url} from Airtable: ${error}
- Unable to resolve fields from header.
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/799e7eb35ffeac07.
Report an issue: GitHub.