Large files cause "body size too long" error
Transforming a large (9.8MB) gif causes a body size too long error. This seems related to the 6MB body payload size, as described in the Lambda Limits page. I think this issue will face image formats other than .gif, that's just what I've seen it pop up on. Log screenshot below.
Any advice for how to work around this?
At the moment, I have an onError function on my <img /> tags that replaces the src with the original non-resized URL. But - this occurs in the worst case scenario, where we have huge files - so it's really not desirable.

I was able to replicate this behavior. As you correctly pointed out, I believe here Lamdba response payload size is causing the issue. It should not be more than 6MB as per the limits page. Would saving image on S3 and returning that url in response rather than the actual image be a valid work around? Refer here for details: https://github.com/thumbor-community/aws#result-storage-settings We can explore tc_aws.result_storages.s3_storage for this use case.
Hi, Any update on this issue or did someone figure out the solution to this issue?
Hi all. We're currently updating the solution and are looking into output storage to an S3 bucket (either a default bucket or specified in the request) as a workaround to the Lambda payload limit. Thanks for your feedback/patience!
I just ran into this with a JPEG unfortunately (reference here: https://docs.aws.amazon.com/lambda/latest/dg/limits.html)
Only recommendation I can give is for people to use the filters:quality(40) URL param option in cases where the image fails to load.
It's a bummer, and I'll post back if I come up with any other clever approach to this.
@hayesry any update on the workaround?
We have added this as a feature request to our backlog for an upcoming release, but don't have an ETA for when it will be ready. Marking the ticket for closure in the meantime.
Thanks @hayesry Really looking forward to this; it's been a tough one to work around :(
that's sad we're trying to deploy a storybook and there's a js file which exceed just 300kb 🤦🏻♂️ . it's a vendor file chunk so we can not even try to cut something off to reach out the 5mb limit. zeit/now is pure love but for this reason we're having to host in another place.
that's sad we're trying to deploy a storybook and there's a js file which exceed just 300kb 🤦🏻♂️ . it's a vendor file chunk so we can not even try to cut something off to reach out the 5mb limit. zeit/now is pure love but for this reason we're having to host in another place.
where are you hosting this now ? If not zeit/now ?
@videoAbyss we’re using a static server. For now firebase hosting
My json data response is 750kb (<<5MB). Why am I also getting this error? @stewwan if your file is 300kb why do you get the error too?
Hi, any updates about this ?
@redayoub have this feature in our backlog, please follow https://github.com/aws-solutions/serverless-image-handler/issues/322.