question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[META] Reduce package size

See original GitHub issue

First, 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

image

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:open
  • Created a year ago
  • Reactions:1
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jaredLundecommented, Sep 6, 2022

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.

1reaction
atdragocommented, Aug 26, 2022

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Meta confirms 11000 layoffs, amounting to 13% of its workforce
Facebook, Instagram and WhatsApp's parent company Meta has confirmed a huge round of layoffs, amounting to 13% of its workforce.
Read more >
How to Reduce Metahuman Project File Size - YouTube
How to reduce an 8.2gb # Metahumans folder to 2.5gb by using Unreal Engine's Batch Export and Irfanview's Batch Conversion, converting most ...
Read more >
Exported Effect Size Limits in Meta Spark Studio
The size limits for the files exported from Meta Spark Studio to Meta Spark Hub make sure your effects perform well across different...
Read more >
CEO Mark Zuckerberg says Meta is firing 11000 employees ...
I've decided to reduce the size of our team by about 13 per cent and let more than 11,000 of our talented employees...
Read more >
Reducing Packaged Game Size - Unreal Engine Documentation
The easiest and quickest way to reduce your APK package size is to tell UE4 to compress the APK packages during the packing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found