I have created a serverless function for generating PDF, and I am using chrome-aws-lambda with puppeteer-core. But when I call chromium.puppeteer.launch, it throws following error:
Cannot find module '/path/to/project/.esbuild/.build/src/functions/generatePdf/puppeteer/lib/Browser'
chrome-aws-lambda trying to look for puppeteer in directory of generatePdf (my function). However looking into source of chrome-aws-lambda, I found that it wants to look in relative directory, where chrome-aws-lambda module resides as following:
So, it wants to load puppeteer libs from same directory, as per source (from github)
Currently, I have no idea, why it is showing such behavior, and after a lot of scavenging, online I couldn't find any fruitful solution.

