[META] Reduce package size
See original GitHub issueFirst, thank you for taking on the maintenance of this module!
What would you like to have implemented?
I’ve got an existing lambda deployed to Vercel that uses the chrome-aws-lambda
package, and works fine in all environments. I wanted to switch to @sparticuz/chrome-aws-lambda
because it uses the updated peer dependency of puppeteer-core
that doesn’t have a node-fetch
vulnerability. Unfortunately, Vercel’s lambdas have a 50 MB or less size requirement, and where chrome-aws-lambda
is around 49 MB, @sparticuz/chrome-aws-lambda
is closer to 52 MB, making it impossible to deploy to Vercel.
I haven’t dug into this package’s code at all, so I’m not sure what’s causing the increase in size from the old to the new version, but I’m curious if there’s a possibility that the size could be reduced to below 50 MB so that it could be used in Vercel lambdas.
Why would it be useful?
Vercel is a platform that is growing in popularity, mainly because it is the default way to deploy Next.js projects. The following is a screenshot of what happens during the Vercel deployment after attempting to switch to @sparticuz/chrome-aws-lambda
I’m using this on my personal website to create a PDF download of one of the pages. The repo is public, so if it helps, here is a PR of the dependency switch which exhibits the build failure. https://github.com/atdrago/adamdrago.com/pull/21
Thank you for considering this request!
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:13 (5 by maintainers)
Top GitHub Comments
I got around this limitation in CloudFront Lambda@Edge by uploading
chromium.br
to S3 and then downloading/caching it on the first invocation of the function. I don’t think one can count on compression to get out of this.I did a little more research, and it looks like this is affecting a lot more people than I thought, isn’t specific to this project (as @Sparticuz mentioned above), and is actually an AWS limitation (not Vercel). Here’s a link to the comment in the Vercel discussion that points this out.
Feel free to close this if you think it’s out of scope. Thanks for looking into it!