Lambda function sharp library "__dirname is not defined in ES module scope"

0

I have a lambda repo set up locally which works fine without a sharp package which I need for the actual use case. After adding sharp package and executing the function, I am getting the error __dirname is not defined in ES module scope. I didn't find anything useful in my day long search. Attaching the repo https://github.com/trsiddiqui/lambda-image-optimization

trsid
asked 6 months ago68 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions