A Serverless Function has exceeded the unzipped maximum size of 250 MB... but which one?
Answered
European pilchard posted this in #help-forum
European pilchardOP
Hello everyoen quick question. Im getting
Error: A Serverless Function has exceeded the unzipped maximum size of 250 MB. : https://vercel.link/serverless-function-size but its useless because its not telling me which function. Is there a way I can see which one it is? Is there a way to see it?33 Replies
You can run next build on your machine
Once it finishes there should be an output of all the functions including their sizes
A similar output can be found in the vercel logs for your deployment
@linesofcode A similar output can be found in the vercel logs for your deployment
European pilchardOP
ill try next build and see. I tried finding the log on vercel, but when I look at the build log, it gives me only that vague line
Hmm im having trouble building locally because its trying to do my supabase edge functionsEDIT: just exlcuded it
@linesofcode Once it finishes there should be an output of all the functions including their sizes
European pilchardOP
So im looking at them, and it seems like like they highest is 90kb. So i would assume that isnt the issue. My issue may lie with me using python in this app as well and trying to deploy it to vercel
Oh yeah
I’ve seen python functions get quite large
But I’m not really sure how to go about fixing that
European pilchardOP
Ya its a tough one, I guess Ill have to try fixing that because I dont see any size issues with my js functions
Thank you
European pilchardOP
Not sure how Vercel handles this, but if installing python packages is considered a serverless function, then this may be the issue. My packages amount to over 250 mb. Which is probably why it still fails, even if I remove my python api route in general, because its still trying to install the dependencies from my Pipfile. Not sure if I can pay more to bypass that limit, otherwise I gotta optimize or something.
@European pilchard Not sure how Vercel handles this, but if installing python packages is considered a serverless function, then this may be the issue. My packages amount to over 250 mb. Which is probably why it still fails, even if I remove my python api route in general, because its still trying to install the dependencies from my Pipfile. Not sure if I can pay more to bypass that limit, otherwise I gotta optimize or something.
I think python dependencies are indeed considered part of the overall function size based on those findings, removing the route was a good way to test.
You’re probably better off just running this specific python code on ec2 or fly.io
Instead of trying to get it running under vercel
European pilchardOP
Probably right, unless I cut down the dependencies. I kinda wanted everything to run under one roof but we’ll see how it goes. Thanks for the help
European pilchardOP
Wait so I just removed all python from my project and Im still getting the error
Well not all of it but I commented out everything and removed all python dependencies
something is off
This is what my build looks like
European pilchardOP
Wish it would just tell me which one tho
Brown bear
@European pilchard did you end up figuring out a fix? im facing a similar issue
European pilchardOP
It’s was my dependencies were too big
Answer
European pilchardOP
Had to remove some
Brown bear
@European pilchard This is what part of my package.json file currently looks like. I'm implementing fastapi on NextJS:
And I have textrazor, fastapi, and uvicorn[standard] in my requirements.txt
the site-packages come up to around 60MB but I get the same error when deploying
@Brown bear the site-packages come up to around 60MB but I get the same error when deploying
European pilchardOP
I’m not sure tbh but it has to be under 250 uncompressed, compressed is like 60 mb
Brown bear
Did you remove the dependencies in the site_packages or node_modules @European pilchard
European pilchardOP
From requirements
Or pipfile
Which ever one
Dutch Smoushond
Also ran into this. I guess when the python build exceeds 50MB it doesn't give any details pointing to the python build as the culprit. Spent a fair amount of time figuring this out 🙂