Cannot read properties of undefined (reading '0')

hi i get this error
Cannot read properties of undefined (reading ‘0’)
i submit my image and it’s work
i try again and it’s give me that error
and i try again and it’s work

so it’s give me that error only sometimes
how to fix that

note: i use same image in all cases

I tested the issue here, but can not recreate it.
=>If you test the connection with Postman, do you get the same result?

You probably know it, but just in case: Postman is a free Chrome app, see Free OCR API

If you see the problem even with Postman, a screenshot of the result could be helpful.

I found the problem i notice that it’s was image size bigger then 1mb

The error message really confusing me
Anyway thanks u for helping, i just wanna suggest make error message say that the attachment size is bigger the the allowed size, bc rn maybe it’s cause confuse for ppl

I am glad that it works again, but I doubt the file size itself was the issue. Because for images or PDF larger than 1MB, the api responds with this “file too big” message:

{
    "OCRExitCode": 3,
    "IsErroredOnProcessing": true,
    "ErrorMessage": [
        "File failed validation. File size exceeds the maximum permissible file size limit of 1024 KB"
    ],
    "ErrorDetails": "",
    "ProcessingTimeInMilliseconds": "681"
}