sambaiz / puppeteer-lambda-starter-kit

Starter Kit for running Headless-Chrome by Puppeteer on AWS Lambda.
MIT License
580 stars 82 forks source link

Add support for Node v8 in aws lambda #27

Open inian opened 6 years ago

inian commented 6 years ago

Changing the environment to node v8 and deploying doesn't work.

tomardern commented 6 years ago

I recommend that the Docs are changed to state that this package only currently works for Node 6.10

cirdes commented 5 years ago

as mentioned on #25 to run on 8.10 we just have to update the nodejs on .babelrc("8.10") and on serverless.yml (nodejs8.10) and change the handler to:

exports.handler = async (event) => {
  let result;
  let browser;
  try {
    browser = await setup.getBrowser();
    result = await exports.run(browser);
  } catch (err) {
        console.log(err);
        return err;
  }
  return result;
};