danielmiessler/Fabric · warning · Error
${fileName}: the conversion returned no text.
Error message
${fileName}: the conversion returned no text. What it means
interpretPdfResult throws when the PDF is not classified as scanned/image-based but result.markdown is empty or whitespace-only — the inspector found a text layer yet extracted zero usable text. This is a data-quality outcome of the WASM conversion, not a crash.
Source
Thrown at web/src/lib/services/PdfConversionService.ts:18
import type { PdfProcessResult } from '@firecrawl/pdf-inspector-wasm';
import type { PdfRequest, PdfResponse } from '../workers/pdf-inspector.worker';
export interface PdfConversion {
markdown: string;
warning?: string;
}
// Maps the raw worker result to UI behavior. Throws when there is no usable text.
export function interpretPdfResult(result: PdfProcessResult, fileName: string): PdfConversion {
if (result.pdfType === 'Scanned' || result.pdfType === 'ImageBased') {
throw new Error(
`${fileName} contains no machine-readable text. OCR is necessary, and the Fabric web interface does not include OCR.`
);
}
const markdown = result.markdown;
if (!markdown || markdown.trim().length === 0) {
throw new Error(`${fileName}: the conversion returned no text.`);
}
const warnings: string[] = [];
if (result.pdfType === 'Mixed') {
warnings.push(
`${fileName}: pages ${result.pagesNeedingOcr.join(', ')} contain no machine-readable text. OCR is necessary for those pages, and their content is not included.`
);
}
if (result.hasEncodingIssues) {
warnings.push(`Some text in ${fileName} did not decode correctly.`);
}
return warnings.length > 0 ? { markdown, warning: warnings.join(' ') } : { markdown };
}
export class PdfConversionService {
private worker: Worker | null = null;
private nextId = 1;
private pending = new Map<
number,View on GitHub (pinned to 338b89cfe9)
Solutions
- Try re-exporting or re-saving the PDF from another tool (reprints a sane text layer)
- If the file is effectively image-based despite classification, OCR it externally as in the scanned case
- Report files where classification says text-bearing but extraction is empty — that is an inspector gap
Defensive patterns
Strategy: validation
Validate before calling
if (!result.markdown || result.markdown.trim().length === 0) {
// classify as 'unusable text layer' before interpretPdfResult throws
} Type guard
function isEmptyConversionError(e: unknown): boolean {
return e instanceof Error && e.message.includes('returned no text');
} Try / catch
try { conversion = interpretPdfResult(result, fileName); }
catch (e) {
if (isEmptyConversionError(e)) { toast.warn('This PDF has no extractable text. Re-export or OCR it.'); return; }
throw e;
} Prevention
- Pre-check markdown emptiness to give a custom message
- Treat zero-text conversions as user guidance, not crashes
When it happens
Trigger: PDFs whose 'text' is only invisible/empty glyph runs; fonts with broken ToUnicode maps yielding whitespace; a text layer consisting solely of whitespace or control characters.
Common situations: Designer PDFs with outlined/curved text; PDFs where text is drawn as vector paths; partially corrupt files that parse but yield nothing.
Related errors
- ${fileName} contains no machine-readable text. OCR is necess
- Invalid response format: missing vendors data
- Invalid session file format
- Pattern validation failed: {validation_message}
AI-assisted analysis of danielmiessler/Fabric@338b89cfe9 (2026-08-15).
Data as JSON: /api/errors/bfb9c8c546b9078c.
Report an issue: GitHub.