docs(troubleshooting): added link to alixaxel/chrome-aws-lambda (#3576)
I've been maintaining and compiling the latest version of Chromium for AWS Lambda. Would be great to have it included in the docs.
This commit is contained in:
parent
927d0f443b
commit
a04100c235
@ -344,14 +344,14 @@ There's also another [simple guide](https://timleland.com/headless-chrome-on-her
|
|||||||
AWS Lambda [limits](https://docs.aws.amazon.com/lambda/latest/dg/limits.html) deployment package sizes to ~50MB. This presents challenges for running headless Chrome (and therefore Puppeteer) on Lambda. The community has put together a few resources that work around the issues:
|
AWS Lambda [limits](https://docs.aws.amazon.com/lambda/latest/dg/limits.html) deployment package sizes to ~50MB. This presents challenges for running headless Chrome (and therefore Puppeteer) on Lambda. The community has put together a few resources that work around the issues:
|
||||||
|
|
||||||
- https://github.com/adieuadieu/serverless-chrome/blob/master/docs/chrome.md (tracks the latest Chromium snapshots)
|
- https://github.com/adieuadieu/serverless-chrome/blob/master/docs/chrome.md (tracks the latest Chromium snapshots)
|
||||||
- https://github.com/universalbasket/aws-lambda-chrome
|
- https://github.com/alixaxel/chrome-aws-lambda (kept updated with the latest stable release of puppeteer)
|
||||||
- https://github.com/Kikobeats/aws-lambda-chrome
|
- https://github.com/Kikobeats/aws-lambda-chrome
|
||||||
|
|
||||||
## Code Transpilation Issues
|
## Code Transpilation Issues
|
||||||
|
|
||||||
If you are using a JavaScript transpiler like babel or TypeScript, calling `evaluate()` with an async function might not work. This is because while `puppeteer` uses `Function.prototype.toString()` to serialize functions while transpilers could be changing the output code in such a way it's incompatible with `puppeteer`.
|
If you are using a JavaScript transpiler like babel or TypeScript, calling `evaluate()` with an async function might not work. This is because while `puppeteer` uses `Function.prototype.toString()` to serialize functions while transpilers could be changing the output code in such a way it's incompatible with `puppeteer`.
|
||||||
|
|
||||||
Some workarounds to this problem would be to instruct the transpiler not to mess up with the code, for example, configure TypeScript to use latest ecma version (`"target": "es2018"`). Another workaround could be using string templates instead of functions:
|
Some workarounds to this problem would be to instruct the transpiler not to mess up with the code, for example, configure TypeScript to use latest ecma version (`"target": "es2018"`). Another workaround could be using string templates instead of functions:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
await page.evaluate(`(async() => {
|
await page.evaluate(`(async() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user