-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
[BUG] ProtocolError: Protocol error (Runtime.callFunctionOn): Target closed. #28
Comments
I'm also getting this, it seems to be an issue with the docker image that Serverless is using. The error I'm seeing is
|
Interesting, I believe that file is included in the aws.tar.br file, but it is only used when running on a native aws image. @daveykane, you are also trying to user sls offline? |
No I’m using The browser launches and I can create a new page but during page.evaluate that error gets thrown. I’ll debug the package to see if aws.tar.br is being used. |
In order to autorun the aws.tar.br file, take a look at https://github.com/Sparticuz/chromium/blob/master/source/index.ts#L41 It requires AWS_EXECUTION_ENV to be set to something that will satisfy that regex. Is that env var set in serverless-localstack? |
It is yes, the value is This line is also being fired ok https://github.com/Sparticuz/chromium/blob/master/source/index.ts#L217 |
I can see the following list of files in on the lambda during execution in the dir
|
I am never able to run chrome in local docker setting using my Mac either. I also get a protocol error. But the same docker container runs on aws lambda and on windows machine. This was true for native chromium package and it seems to be true for this package as well. |
Hey @Sparticuz the above mentioned fix makes it work in docker for macos? Were you able to do so yourself? |
This package can't support arm yet, so you need to run your own version of chromium until I'm able to support arm. I've documented how you can do that natively. In a docker, you'll need to do some trickery. Either do a bind mount to a host version of chromium, or run some code on container start to install chromium. (see @puppeteer/browsers) |
Thanks for the info @Sparticuz! |
Environment
chromium
Version: 109.0.0puppeteer
/puppeteer-core
Version: 19.4.0serverless offline
pluginExpected Behavior
Page should load without errors.
Current Behavior
Getting an error:
ProtocolError: Protocol error (Runtime.callFunctionOn): Target closed.
Steps to Reproduce
When using deprecated @sparticuz/chrome-aws-lambda package, there is no error.
The text was updated successfully, but these errors were encountered: