You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have this in production on Vercel, and I get built errors now that there are more than 100 pages.
Error: The Serverless Function "api/og" is 56.39mb which exceeds the maximum size limit of 50mb. Learn More: https://vercel.link/serverless-function-size
The text was updated successfully, but these errors were encountered:
Hey @neg4n, I figured it out. So the problem is that AWS has a 50MB limit on Serverless functions. By adding more libraries on the server side, it passed the hard limit. My solution was to move the OG generation as a separate app, so I call it from https://og.domain.com/api/og
Hope this helps people who also stumble upon this issue
I ran into this as well. Some steps for others to help debug the issue:
ensure tree shaking is working properly and make sure your serverless function imports are as minimal as possible
ensure large third-party libraries have "sideEffects": false in their package.json (otherwise vercel's bundler may be forced to include them in your lambda even if they're not used)
Even with these changes, the serverless function size is really close to the Vercel / AWS limit at 49.7MB. If this is the case for you, then consider downgrading to an earlier version of chrome-aws-lambda, some of which are much smaller.
Hey!
I have this in production on Vercel, and I get built errors now that there are more than 100 pages.
Error: The Serverless Function "api/og" is 56.39mb which exceeds the maximum size limit of 50mb. Learn More: https://vercel.link/serverless-function-size
The text was updated successfully, but these errors were encountered: