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
質問済み 6ヶ月前70ビュー
回答なし

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ