Next js Fast API . A Serverless Function has exceeded max size 250mb #79220
Unanswered
suntochukwu
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I’ve deployed my project and get a cryptic error:
Error: A Serverless Function has exceeded the unzipped maximum size of 250 MB. : Troubleshooting Build Error: “Serverless Function has exceeded the unzipped maximum size of 250 MB”
-No information as to which function in particular .
I’ve added outputfiletracing to the next.config- don’t know which paths to exclude because i can’t see where the issue is. The log on build is:
./components/ui/related_articles.tsx
34:9 Warning: Using
<img>
could result in slower LCP and higher bandwidth. Consider using<Image />
fromnext/image
to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-elementinfo - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/app/api-reference/config/eslint#disabling-rules
Collecting page data ...
Generating static pages (0/23) ...
generating sitemap data
Generating static pages (5/23)
sitemap data generated successfully
Generating static pages (11/23)
Generating static pages (17/23)
✓ Generating static pages (23/23)
Finalizing page optimization ...
Collecting build traces ...
Route (app) Size First Load JS
┌ ○ / 10.4 kB 191 kB
├ ○ /_not-found 990 B 103 kB
├ ○ /about 5.74 kB 149 kB
└ ○ /sitemap.xml 141 B 102 kB
├ chunks/1684-99765a90fe2aba6a.js 46.4 kB
├ chunks/4bd1b696-bf14931f48e91d91.js 53.2 kB
└ other shared chunks (total) 2.02 kB
ƒ Middleware 33.2 kB
○ (Static) prerendered as static content
ƒ (Dynamic) server-rendered on demand
Traced Next.js server files in: 59.794ms
Created all serverless functions in: 170.631ms
Collected static files (public/, static/, .next/static): 18.071ms
Installing required dependencies...
Build Completed in /vercel/output [2m]
Deploying outputs...
Error: A Serverless Function has exceeded the unzipped maximum size of 250 MB. : https://vercel.link/serverless-function-size
My config file:
Yes that’s where the serverless functions are stored.
My next js directory looks like:
api
|->pycache(folder)
| |->index.cpython39 etc
| -index.py
app
|->aboutus (folder)
| |->page.ts
|–> other_pages(folder)
|->pages.ts
Index.py is where all the endpoints are, it’s just standard endpoints:
Can anyone help with this? I need to deploy this application asap and this issue is ridiculous; no clarity at all.
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions