lambda-screenshot-as-a-service icon indicating copy to clipboard operation
lambda-screenshot-as-a-service copied to clipboard

Unable to start Chrome

Open thecoconutstudio opened this issue 5 years ago • 9 comments

Thank you so much for putting together your article. I too have been struggling with all the different examples online. Hopefully your solution will end up working. However I'm getting an Error when navigating to the end point Unable to start Chrome

image

image

thecoconutstudio avatar Feb 18 '20 14:02 thecoconutstudio

same problem !

vincentcau avatar Feb 18 '20 17:02 vincentcau

I managed to fix this finally. I presumed you cloned the repo like I did.

Instead of using npm install I ran yarn install

I also ran yarn add @serverless-chrome/lambda gm puppeteer-core superagent aws-sdk url yarn add --dev serverless-plugin-chrome

Not sure if it was in that order, but it definitely started me on the right direction. I then had some s3 storage permission issues...

thecoconutstudio avatar Feb 18 '20 19:02 thecoconutstudio

I have alway this problem with yarn

"errorMessage": "Unable to start Chrome.

do you change something in the serverless.yml ?

Capture d’écran 2020-02-18 à 23 02 07

vincentcau avatar Feb 18 '20 22:02 vincentcau

I have the same problem ...

image

I think there is also another problem, AWS Lambda does not support node8.10 anymore. Just node12.x ...

michaldolnik avatar Apr 21 '20 12:04 michaldolnik

Same here

fuschini avatar Apr 30 '20 21:04 fuschini

Hi if you want an other solution it work for me with this rep : https://github.com/alixaxel/chrome-aws-lambda

and prebuid the layer like this

#!/bin/bash
set -e
rm -fr chrome-aws-lambda
git clone --depth=1 https://github.com/alixaxel/chrome-aws-lambda.git
cd chrome-aws-lambda
mkdir -p ../chrome-layer 
make ../chrome-layer/chrome_aws_node10x.zip
ls -lah ../chrome-layer/chrome_aws_node10x.zip
rm -fr ../chrome-aws-lambda
echo 'Layer created successfully!'

then use the layer on your serverless.yml (with runtime: nodejs10.x)

layers:
  chromePreBuilt:
    package:
      artifact: chrome-layer/chrome_aws_node10x.zip

vincentcau avatar Apr 30 '20 21:04 vincentcau

I have the same problem ...

image

I think there is also another problem, AWS Lambda does not support node8.10 anymore. Just node12.x ...

I did have this same problem, but managed to fix it with the steps above. Also working with "runtime": "nodejs8.10"

thecoconutstudio avatar May 01 '20 10:05 thecoconutstudio

@vincentcau that repo worked for me too straight out of the box!

fuschini avatar May 01 '20 13:05 fuschini

Oh hey I totally missed this. This lambda should work now. I had the same issue a few months ago

Swizec avatar Aug 27 '20 22:08 Swizec