RafalWilinski / serverless-puppeteer-layers

Serverless Framework + AWS Lambda Layers + Puppeteer = ❤️
https://dynobase.com
274 stars 36 forks source link

puppeteer 1.12.x #8

Closed Meekohi closed 5 years ago

Meekohi commented 5 years ago

Hey, anyone know what's involved in getting a new binary that will work with puppeteer 1.12? I checked out https://github.com/alixaxel/chrome-aws-lambda but wasn't quite clear what the strategy would be to generate the actual binary to swap in.

schmaluk commented 5 years ago

This solution works greatly with layers. Thanks to the creator. Im just using it with puppeteer-core instead of puppeteer for excluding the binary. Would also like to know how to build a headless_shell file for puppeteer. Thanks in advance

vuk-nikolic commented 5 years ago

Same here @RafalWilinski, would love to know how to update headless_shell 👍

san-kumar commented 5 years ago

First extract the binary as described here https://github.com/alixaxel/chrome-aws-lambda#aws-lambda-layer

Basically this command

git clone --depth=1 https://github.com/alixaxel/chrome-aws-lambda.git && \
cd chrome-aws-lambda && \
brotli --decompress --rm bin/chromium-*.br && \
npm pack && \
mkdir -p nodejs/node_modules/chrome-aws-lambda/ && \
tar --directory nodejs/node_modules/chrome-aws-lambda/ --extract --file chrome-aws-lambda-*.tgz --strip-components=1 && \
rm chrome-aws-lambda-*.tgz

then copy the file inside the bin directory into the layers directory like this:

cp [chrome-aws-lambda directory]/bin/chromium-74.0.3723.0 [serverless-puppeteer-layers directory]/layer/headless_shell

This should also fix any internal server errors too.. hth!

chemitaxis commented 5 years ago

Hi @san-kumar can you please try to do a new PR with the last version of Chromium? Thanks

chemitaxis commented 5 years ago

Maybe @RafalWilinski can help us with the project...

RafalWilinski commented 5 years ago

Closed in https://github.com/RafalWilinski/serverless-puppeteer-layers/pull/10