When trying to use chrome-aws-lambda via serverless sst the default mode for compiling the files is to output them to ES modules. There's a reference to dirname in the code that fails as it isn't defined when code runs as an ES module. This is just a change to polyfill filename and __dirname if they don't exist.
I can't run this locally at the moment as I have an M1 mac. If you have any pointers on how to run chrome-aws-lambda locally on an M1 mac I can do some testing to verify the changes but am currently unable to do so.
When trying to use chrome-aws-lambda via serverless sst the default mode for compiling the files is to output them to ES modules. There's a reference to dirname in the code that fails as it isn't defined when code runs as an ES module. This is just a change to polyfill filename and __dirname if they don't exist.
I can't run this locally at the moment as I have an M1 mac. If you have any pointers on how to run chrome-aws-lambda locally on an M1 mac I can do some testing to verify the changes but am currently unable to do so.