Next.js Discord

Discord Forum

Error: The Serverless Function "index" is 701.49mb which exceeds the maximum size limit of 300mb.

Unanswered
Alligator mississippiensis posted this in #help-forum
Open in Discord
Alligator mississippiensisOP
When deploying my app to vercel, I get this error "The Serverless Function "index" is 701.49mb which exceeds the maximum size limit of 300mb.".
In my "app" directory there is no page named index, and also in my api route.
How to fix it? 🙂

13 Replies

@aardani what about `/` route?
Alligator mississippiensisOP
I guess that was the problem.
Thanks! 😁
what .-.
Alligator mississippiensisOP
@aardani Is it possible to view locally (without deploying the app to Vercel) the size of a Serverless function?
just npx next build
and see the build log?
or maybe thats different hmm
@aardani and see the build log?
Alligator mississippiensisOP
Where is the build log located?
@Alligator mississippiensis Where is the build log located?
after you build the project locally
theres a summary of routes in the end
@aardani after you build the project locally
Alligator mississippiensisOP
But on the local build it's displaying 20kb, while on Vercel build it's displaying 755.88mb 🤔
i think its the compiled size