FlowiseAI/Flowise · error · Error
Unsupported source type: ${block.source_type}
Error message
Unsupported source type: ${block.source_type} What it means
Thrown at the end of fromStandardImageBlock (line 161) after the only two recognized source_type values ('url' and 'base64') have been checked. Any other source_type for a standard image block reaches this terminal throw.
Source
Thrown at packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/FlowiseChatGoogleGenerativeAI.ts:161
}
} else {
return {
fileData: {
mimeType: block.mime_type ?? '',
fileUri: block.url
}
}
}
}
if (block.source_type === 'base64') {
return {
inlineData: {
mimeType: block.mime_type ?? '',
data: block.data
}
}
}
throw new Error(`Unsupported source type: ${block.source_type}`)
},
fromStandardAudioBlock(block): FileDataPart | InlineDataPart {
if (!isMultimodalModel) {
throw new Error('This model does not support audio')
}
if (block.source_type === 'url') {
const data = parseBase64DataUrl({ dataUrl: block.url })
if (data) {
return {
inlineData: {
mimeType: data.mime_type,
data: data.data
}
}
} else {
return {
fileData: {View on GitHub (pinned to abe4a8601a)
Solutions
- Normalize image blocks to source_type 'url' (with block.url) or 'base64' (with block.data) before sending to the Gemini node.
- Use LangChain's standard DataContentBlock helpers to construct blocks so the source_type is always valid.
- Log block.source_type upstream to catch the offending producer.
Example fix
// before (throws): { type:'image', source_type:'file', path:'/x.png' }
// after: { type:'image', source_type:'base64', mime_type:'image/png', data: base64String } Defensive patterns
Strategy: validation
Validate before calling
const ALLOWED_IMG_SOURCE = new Set(['url', 'base64'])
function validImageSources(parts: any[]): boolean {
return parts.filter((p) => p?.type === 'image').every((p) => ALLOWED_IMG_SOURCE.has(p.source_type))
}
if (!validImageSources(allParts)) throw new Error('image blocks must use source_type url|base64') Type guard
type StdImageBlock =
| { type: 'image'; source_type: 'url'; url: string; mime_type?: string }
| { type: 'image'; source_type: 'base64'; data: string; mime_type?: string }
function isStdImageBlock(c: unknown): c is StdImageBlock {
if (typeof c !== 'object' || c === null || (c as any).type !== 'image') return false
const st = (c as any).source_type
return (st === 'url' && typeof (c as any).url === 'string')
|| (st === 'base64' && typeof (c as any).data === 'string')
} Try / catch
try {
return convertToProviderContentBlock(block, converter)
} catch (e) {
if (e instanceof Error && /Unsupported source type/.test(e.message)) {
// normalize block.source_type to 'url' or 'base64' and retry
}
throw e
} Prevention
- Always build image blocks with LangChain DataContentBlock helpers so source_type is valid.
- Reject blocks whose source_type is not in the allow-list at ingestion.
- Add a producer-side contract test for content-block shapes.
When it happens
Trigger: A standard image content block whose source_type is neither 'url' nor 'base64' (e.g., 'file', 'path', 'stream', undefined-but-not-matching).
Common situations: A custom content producer invents a source_type, a schema migration renamed the field, or a DataContentBlock from another provider is passed through without normalization.
Related errors
- Please provide image as base64 encoded data URL
- Invalid media content
- This model does not support images
- Unknown content type ${content.type}
- Unknown content ${JSON.stringify(content)}
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/af73421ca6eea47c.
Report an issue: GitHub.