Home
Support Forums

Cannot deploy site due to too large function - Node v16.12?

On October 15, I was able to deploy resoc-netlify-image-engine-demo.netlify.app

I tried to deploy it again today, but it failed due to a too large Netlify function:

Request must be smaller than 69905067 bytes for the CreateFunction operation

I rolled back all my changes to reproduce the successful deploy of October 15th. Unfortunately, it still fails.

When comparing the build logs, the only significant difference I note is the new Node and NPM versions. On October 15h, I got:

Now using node v16.11.1 (npm v8.0.0)

Now:

Now using node v16.12.0 (npm v8.1.0)

The Netlify function I try to deploy is big (it runs Puppeteer). Still, I expect to be able to deploy the project that used to work a few days ago. Or maybe I miss something?

Hi @Philippe,

I’d assume someone changed with the dependency (or Node as you say). The error that you’re getting is thrown by AWS as they don’t allow functions’ zips to be greater than 50 MiB.

Here’s a similar thread:

1 Like

Hey @hrishikesh, thank you for your answer!

Yes, the post you quote is apparently the same issue. The function @abusedmedia mentions is called render, which makes me think Puppeteer might be used here, too (but that’s just an hypothesis of course).

The screenshot API service, created by @zachleat, is still deployable. The zipped function is 50,444 KB. The project itself can be considered as a minimalist Puppeteer proof of concept on Netlify, as it only requires @netlify/functions, chrome-aws-lambda and puppeteer-core, and the function itself is 7 KB of code.

When I encountered an error yesterday, my function was just above 51 MB. I managed to reduce it to 50,563 KB and now it can be deployed.

Bottom line: a Netlify function can use Puppeteer, but it needs to be careful to fit in.