PaddlePaddle/PaddleOCR · error

${warnings.join(" ")} (pipeline warnings promoted to errors

Error message

${warnings.join(" ")} (pipeline warnings promoted to errors when warningBehavior="error")

What it means

The pipeline collects non-fatal configuration warnings (strings) while resolving options. Normally they are printed via console.warn with a [PaddleOCR.js] prefix, but if warningBehavior is set to 'error', emitPipelineWarnings() joins them and throws, turning every accumulated warning into a hard failure with the warning texts concatenated as the message.

Source

Thrown at paddleocr-js/packages/core/src/pipelines/ocr/shared.ts:350

  }
  if (explicitBatch.rec !== undefined) {
    merged.textRecognitionBatchSize = explicitBatch.rec;
  }
  if (explicitBatch.pipeline !== undefined) {
    merged.pipelineBatchSize = explicitBatch.pipeline;
  }
  return merged;
}

function resolveWarningBehavior(value: unknown): "warn" | "ignore" | "error" {
  if (value === "ignore" || value === "error") return value;
  return "warn";
}

function emitPipelineWarnings(warnings: string[], behavior: "warn" | "ignore" | "error"): void {
  if (!warnings.length || behavior === "ignore") return;
  if (behavior === "error") {
    throw new Error(warnings.join(" "));
  }
  for (const warning of warnings) {
    console.warn(`[PaddleOCR.js] ${warning}`);
  }
}

function resolveModelAssetByName(_modelRole: string, modelName: string): ModelAsset {
  const asset = DEFAULT_MODEL_ASSETS[modelName];
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- runtime guard for missing Record key
  if (!asset) {
    throw new Error(`Unknown model asset "${modelName}".`);
  }
  return { url: asset.url };
}

function getSelectedModelName(
  baseSelection: PipelineModelSelection | null,
  configSelection: PipelineModelSelection | null,

View on GitHub (pinned to 2661c7c0ef)

Solutions

  1. Read the thrown message: each sentence is one warning describing the exact config problem; fix each one.
  2. Temporarily set warningBehavior to 'warn' to see the full list via console.warn and fix them one by one before re-enabling 'error'.
  3. If a warning is a false positive for your setup, adjust the offending option rather than disabling strict mode globally.

Example fix

// before
const ocr = await PaddleOCR.create({
  pipelineConfig: { warningBehavior: 'error' },
  // ... config that triggers a deprecation warning
});

// after
const ocr = await PaddleOCR.create({
  pipelineConfig: { warningBehavior: 'error' },
  // warning-triggering option corrected per the warning text
});
Defensive patterns

Strategy: try-catch

Try / catch

try {
  const ocr = await PaddleOCR.create(opts);
} catch (e) {
  if (e instanceof Error && /warningBehavior/.test(e.message)) {
    // each sentence in the message is one promoted warning; log and fix individually
  } else {
    throw e;
  }
}

Prevention

When it happens

Trigger: Setting warningBehavior: 'error' (in pipeline config or options) while the resolved configuration still produces at least one warning, e.g. a deprecated option or an ambiguous/implicit model selection that only warns by default.

Common situations: Teams enabling strict mode in CI to catch deprecated usage; upgrading the library where previously-tolerated config now emits warnings that fail the build once warningBehavior='error' is turned on.

Related errors


AI-assisted analysis of PaddlePaddle/PaddleOCR@2661c7c0ef (2026-08-14). Data as JSON: /api/errors/6042829c5ed7d0ef. Report an issue: GitHub.