Skip to content

Example Next.js 10 project for using Puppeteer on AWS Lambda

License

Notifications You must be signed in to change notification settings

hunterbecton/next.js-lambda-puppeteer

 
 

Repository files navigation

Next.js 10 AWS Lambda Puppeteer

A Next.js 10 application template that includes Puppeteer and chrome-aws-lambda. This application is a simple showcase of how to setup chrome-aws-lambda using puppeteer, and an example api route that screenshots another page and returns it as the response body.

Local Development

Installation

  • Install dependencies via yarn install
  • Run yarn dev
Pitfalls that it took ages to find solutions to...
  • If you are screenshotting pages in this application, for local development Puppeteer's waitfor value must be set to networkidle2 to prevent hanging, because the dev server keeps 1+ connections alive for quick-refreshing the page. For Lambda environments, this should be set to networkidle0.

About

Example Next.js 10 project for using Puppeteer on AWS Lambda

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 67.2%
  • JavaScript 32.8%