I have an S3 bucket that emits an event to a sns topic, which an sqs queue is subscribed to. My lambda dequeues from the sqs queue. It then invokes Sharp to reduce the byte size of the image that was added to the S3 bucket. Everything is working except when the lambda invokes sharp to reduce the image size. The lambda's node runtime environment is nodejs20.
The lambda stops executing when it hits this line. Node does not throw an error -- the lambda appears to be silently failing. I wish I had an exception to read, but I do not have one.
Does anyone know why the lambda stops executing on that line that invokes Sharp? Is Sharp silently failing -- if so, why is it failing? I cannot seem to pinpoint the problem. Is there something wrong with how I've set up my sharp lambda layer?
const reducedBuffer = await sharp(imgData).webp({ quality: 20 }).toBuffer();
I've added sharp as a lambda layer here and I've associated the layer to the lambda here. I've read all of these docs to set up my lambda so that it can process the sharp lambda layer correctly:
- /
- .html
- github issue,
Thank you for looking into my question!