I am trying to upload an image to my GraphQL API. I do this by base64-encoding the image, so my request looks something like this:
This works fine on Firefox, and it works fine for some images on Google Chrome. However, Chrome fails for other images, with the generic “Failed to Fetch” error. The request remains in the “Pending” state in the Network tab.
I think the failures only occur when the Content-Length is too high – somewhere around 50000 bytes upward.
My questions:
- Why is this hapenning? I cannot find any information to suggest Google Chrome should reject larger payloads (which are still not large).
- Is there a way to debug a “Failed to Fetch” error further? It’s not a very helpful error message.
- Can I fix it?