PaddlePaddle/PaddleOCR · error
Unsupported pipeline_name "${pipelineName}". PaddleOCR.js cu
Error message
Unsupported pipeline_name "${pipelineName}". PaddleOCR.js currently supports only "${SUPPORTED_PIPELINE_NAME}". What it means
Thrown by normalizeOcrPipelineConfig() when pipeline_name is present but is not the single supported value (SUPPORTED_PIPELINE_NAME, "OCR"). This JS port implements one pipeline only; anything else — including sibling PaddleOCR pipeline names like "PP-StructureV3" or "document_preprocessor" — is rejected up front.
Source
Thrown at paddleocr-js/packages/core/src/pipelines/ocr/config.ts:138
const asset = normalizeModelAsset(assetName, moduleConfig.model_dir);
validateModuleAsset(modulePath, getModuleModelName(moduleConfig));
return asset;
}
throw new Error(
`${modulePath}.model_dir must be null or an asset descriptor object in browser usage.`
);
}
export function parseOcrPipelineConfigText(text: string): YamlObject {
return parsePipelineConfigInput(text);
}
export function normalizeOcrPipelineConfig(input: unknown): NormalizedPipelineConfig {
const config = parsePipelineConfigInput(input);
const pipelineName = (config.pipeline_name as string | undefined) ?? SUPPORTED_PIPELINE_NAME;
if (pipelineName !== SUPPORTED_PIPELINE_NAME) {
throw new Error(
`Unsupported pipeline_name "${pipelineName}". PaddleOCR.js currently supports only "${SUPPORTED_PIPELINE_NAME}".`
);
}
const warnings: string[] = [];
const subModules = isPlainObject(config.SubModules) ? config.SubModules : {};
const textDetection = isPlainObject(subModules.TextDetection) ? subModules.TextDetection : null;
const textRecognition = isPlainObject(subModules.TextRecognition)
? subModules.TextRecognition
: null;
if (!textDetection || !textRecognition) {
throw new Error(
'OCR pipeline config must define both "SubModules.TextDetection" and "SubModules.TextRecognition".'
);
}
const useDocPreprocessor = Boolean(config.use_doc_preprocessor);View on GitHub (pinned to 2661c7c0ef)
Solutions
- Set pipeline_name: OCR (exact case) in the config
- Or omit pipeline_name — it defaults to the supported value
- If you need a different pipeline (structure, doc preprocessing), this library cannot serve it; use the Python package or wait for support
Example fix
# before pipeline_name: PP-StructureV3 # after pipeline_name: OCR
Defensive patterns
Strategy: validation
Validate before calling
const name = (config.pipeline_name as string | undefined) ?? "OCR";
if (name !== "OCR") {
throw new Error(`Only the "OCR" pipeline is supported; config asks for "${name}"`);
} Type guard
function isSupportedPipeline(name: unknown): name is "OCR" {
return name === undefined || name === "OCR";
} Prevention
- Omit pipeline_name or set it to exactly "OCR"
- Do not reuse pipeline YAML from other PaddleX products in this JS port
- The check is case-sensitive — "ocr" fails
When it happens
Trigger: Passing a config with pipeline_name: "PP-OCRv5" or "PP-Structure"; reusing a PaddleX pipeline YAML from another product; pipeline_name spelled with different casing ("ocr"), since the comparison is case-sensitive.
Common situations: Copying a Python PaddleOCR 3.x config file that names a different pipeline; assuming the JS port covers the same pipeline matrix as the Python package; casing/whitespace differences after templating.
Related errors
- OCR pipeline config must define both "SubModules.TextDetecti
- OCR pipeline config text must decode to an object.
- OCR pipeline config must be an object or YAML text.
- ${modulePath}.model_dir must be null or an asset descriptor
- RecResizeImg.image_shape is required in rec inference.yml
AI-assisted analysis of PaddlePaddle/PaddleOCR@2661c7c0ef (2026-08-14).
Data as JSON: /api/errors/144970b9063246da.
Report an issue: GitHub.