最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

typescript - Sharp "silently fails" In An AWS Lambda Execution environment - Stack Overflow

programmeradmin6浏览0评论

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!

发布评论

评论列表(0)

  1. 暂无评论