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

Chromium 50MB AWS Lambda Node 12 Mega Issue #17

Open
zachleat opened this issue Nov 24, 2022 · 4 comments
Open

Chromium 50MB AWS Lambda Node 12 Mega Issue #17

zachleat opened this issue Nov 24, 2022 · 4 comments

Comments

@zachleat
Copy link
Member

zachleat commented Nov 24, 2022

Spawned from #13. Related to #15.

Ideally we could upgrade the node runtime https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html but newer versions of puppeteer blow past the 50MB AWS Lambda limit. I haven’t tested all versions of Puppeteer to see if there are some that work in Node 14 but don’t hit the 50MB limit yet.

Right now the workaround/requirement is to put an environment variable in your Netlify app UI setting AWS_LAMBDA_JS_RUNTIME to nodejs12.x. This cannot be set via netlify.toml (https://answers.netlify.com/t/netlify-functions-and-env-variables-from-netlify-toml/4404/28)

PR #14 uses the new package from Sparticuz: Sparticuz/chromium#8

There is a hard deadline on this one (March 31, 2023) as Node 12 in AWS is going away: https://aws.amazon.com/blogs/developer/announcing-the-end-of-support-for-node-js-12-x-in-the-aws-sdk-for-javascript-v3/

Related:

@aarongustafson
Copy link

Any updates on this?

@jaimeiniesta
Copy link

In case it helps, here's an example to get a screenshot, that works with chromium-min, and puppeteer 18. Using chromium-min is the key here to get smaller deployments.

https://github.com/jaimeiniesta/screenshot-nextjs

The only issue I have is that fullPage: false is not respected and it always returns a full page screenshot. I have a PR to upgrade to puppeteer 19 where the screenshot size works as expected, but it times out in Vercel and I still don't know why.

jaimeiniesta/screenshot-nextjs#9

@matfantinel
Copy link

Am I correct in assuming there's no way to deploy this package as-is to Netlify until this is resolved?

@aarongustafson
Copy link

Am I correct in assuming there's no way to deploy this package as-is to Netlify until this is resolved?

That's my experience, yes

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

No branches or pull requests

4 participants