Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example not working when I publish #40

Open
pachirulo opened this issue Oct 22, 2018 · 11 comments
Open

Example not working when I publish #40

pachirulo opened this issue Oct 22, 2018 · 11 comments

Comments

@pachirulo
Copy link

Hi everyone,

I can't make it run the basic sample at index script on a lambda function, here's what I did:

Clone this repo and then run npm install... test locally and works.

Then I run serverless deploy, everything get published, but when I run I always have this issue:
"errorMessage": "No node found for selector: #lst-ib", (to test, I simply go to the lambda function, and run a test)

Actually, I can't inspect any element, If I use waitForSelector I have a timeout, so I assume that page never get loaded.

Here's part of log:

START RequestId: 031bea5a-d60d-11e8-94d7-015d775a53cf Version: $LATEST
2018-10-22T15:13:22.647Z 031bea5a-d60d-11e8-94d7-015d775a53cf setup local chrome
2018-10-22T15:13:24.574Z 031bea5a-d60d-11e8-94d7-015d775a53cf setup done
2018-10-22T15:13:25.359Z 031bea5a-d60d-11e8-94d7-015d775a53cf launch done: HeadlessChrome/67.0.3361.0

Is there an issue with this build or I'm missing something?

Thanks in advance.

@vbrundic
Copy link

vbrundic commented Feb 1, 2019

Your browser is starting properly, but must likely puppeteer isn't working.
The problem here is that only certain versions of puppeteer will work with this compiled binary included in the package.
At the moment, in package.json you have puppeteer dependency declared with version "^1.0.3" which means, when you run npm install it will fetch the latest available package. Anything up till 1.10 works, but if you install 1.11 or 1.12 - it will fail.

Just use the 1.0.3 puppeteer with the 67 binary and you'll be good to go. Also, change the package.json

@prithvi514
Copy link

@vbrundic
I deployed the package.zip with chrome

  1. without modifying package.json
  2. changing puppeteer version to ~1.3.0 in package.json and re-packaging

Both resulted in the same error. Please help

START RequestId: c6f56420-aca0-46ee-b8e8-26f9780d85ca Version: $LATEST
END RequestId: c6f56420-aca0-46ee-b8e8-26f9780d85ca
REPORT RequestId: c6f56420-aca0-46ee-b8e8-26f9780d85ca	Duration: 3003.29 ms	Billed Duration: 3000 ms 	Memory Size: 128 MB	Max Memory Used: 87 MB	
2019-02-06T05:46:54.232Z c6f56420-aca0-46ee-b8e8-26f9780d85ca Task timed out after 3.00 seconds```

@anagio
Copy link

anagio commented Feb 15, 2019

I was running into this same issue and it was due to a newer version of puppeteer being installed. I deleted my node_modules folder then pinned the version of puppteer in my package.json to "puppeteer": "1.10" and ran npm install. I re packaged and deployed and the sample script is working for me I see the source logged but also the element just has a bad selector (I think). So it's working if you see the html in cloudwatch logs.

image

@jprivillaso
Copy link

jprivillaso commented Feb 19, 2019

It would be nice if anyone states explicitly the versions which are compatible with this lib :)
Took me so much time to realize that I was using the wrong version of puppeteer too. It only works for versions till ^1.1.0 by the time I'm writing this comment.
Thanks in any case for the great job 👍

@alexandrzavalii
Copy link

I had "puppeteer": "1.1.1" and it was silently failing, without any exceptions.
1.1.0 version works!

@feliun
Copy link

feliun commented Feb 23, 2019

With this version I can't find a puppeteer version that works, not even 1.1.0 :( It gets stuck in this line

@jprivillaso
Copy link

jprivillaso commented Feb 23, 2019

@feliun I am using the other file headless_shell.tar.gz.
And I'm using puppeteer 1.1.1
I didn't try with the other one. It's working fine for me. Whenever it gets stuck at the line 'newPage' it is a version problem for sure .

@feliun
Copy link

feliun commented Feb 23, 2019

I just downloaded the exact example from the repo, deployed the lambda and didn't work out of the box with 1.1.1. Some people stated the puppeteer version should be downgraded but not even like that. If it's not the code, could it be something different on my lambdas @jprivillaso ? Maybe the region or the stage?

@feliun
Copy link

feliun commented Feb 23, 2019

Bloody hell! Yeah I was using the caret coming from the repo. When I changed my package.json to "puppeteer": "~1.1.0", it did work!

@jprivillaso
Copy link

I can share later the codebase that I am using if you want

@mglasgow
Copy link

mglasgow commented Apr 5, 2019

I had the same problem. I've submitted two PRs to update this starter kit:
First pins puppeteer to v1.3.0, which is the latest which puppeteer itself bundled with chrome v67: #45
Second PR updates to nodejs 8.10 syntax and fixes the google query element selector: #46

Hopefully these PRs will be integrated soon. Otherwise, you can find them already integrated on my fork: https://github.com/mglasgow/puppeteer-lambda-starter-kit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants