### ❓ Issue: "HTTP 422 - Empty file sent" when using `Base64Input` with Mindee V2 SDK

Hi Mindee team πŸ‘‹

I’m integrating the Mindee OCR API inside a NestJS backend (running in Docker),
and I’m getting a consistent HTTP 422 - Empty file sent error when using Base64Input with the V2 client.


🧩 Code example

this.client = new mindee.ClientV2({
  apiKey: config.apiKey,
});

async parseReceipt(imageBase64: string): Promise<OCRResult> {
  const inputSource = new mindee.Base64Input({
    inputString: imageBase64,
    filename: 'receipt.jpg',
  });

  // I also tried manually initializing:
  // await inputSource.init();
  // The Buffer is correctly filled here.

  const apiResponse = await this.client.enqueueAndGetInference(
    inputSource,
    {
      modelId: this.modelId,
      rawText: true,
    }
  );

  return {};
}

βš™οΈ Context

  • SDK: mindee (latest, ClientV2)

  • Environment: NestJS (Node 20, Docker)

  • Model: <model_uuid_in_model_config>

  • Input: Base64-encoded JPEG
    (I confirmed it’s valid and decodes properly)


🧠 What I noticed

Even when I manually run await inputSource.init(),
the inputSource.buffer is correctly filled with the decoded image data.

However, as soon as I call:

await this.client.enqueueAndGetInference(inputSource, { modelId: this.modelId })

the SDK still throws:

MindeeHttpErrorV2: HTTP 422 - Empty file sent.


πŸ™ Question

Is there something I’m missing when using Base64Input with ClientV2?
Does it need a specific encoding format or initialization step before sending?

Thanks for your help!

Please authenticate to join the conversation.

Upvoters
Status

Completed

Board

πŸ› Bug Report

Date

4 months ago

Author

Folly Epiphane AVLAH

Subscribe to post

Get notified by email when there are changes.