functions-samples icon indicating copy to clipboard operation
functions-samples copied to clipboard

[BUG] in vision-annotate-images: Unexpected token o in JSON at position 1

Open frederikbrammer opened this issue 4 years ago • 4 comments

Which sample has a bug?

vision-annotate-images

How to reproduce the issue

Deploy the function as documented, then call it from Swift, it returns the following error:

Debug output

Optional(__C.FIRFunctionsErrorCode)
Unexpected token o in JSON at position 1

Errors in the console logs

Screenshots

Expected behavior

The function should return a json string containing the text boxes.

Actual behavior

It crashed and returned nil.

frederikbrammer avatar Apr 01 '21 06:04 frederikbrammer

The problem is still here.

Kanunnikoff avatar Jan 06 '22 14:01 Kanunnikoff

Problem still in here. I think is something about the way JSON is parsed, but its almost 9 months and no response

NicolaiBure avatar Jan 09 '22 16:01 NicolaiBure

This helped me: https://www.buzzphp.com/posts/cloud-function-annotateimage-returns-unexpected-token-o-in-json-at-position-1

Kanunnikoff avatar Jan 09 '22 18:01 Kanunnikoff

Hi. I also have to change the default function on the server. I made two new functions one for a image in base64 format and another when I use the URI

Thanks for the help. Your solution is the one that I needed. Too much time for Google/Firebase to help

NicolaiBure avatar Jan 09 '22 19:01 NicolaiBure