Next.js Discord

Discord Forum

Need Help with "Maximum number of routes (rewrites, redirects, etc) exceeded." Error deploying Next.

Answered
Brewer's Blackbird posted this in #help-forum
Open in Discord
Brewer's BlackbirdOP
Has anyone had issues with the "Routes created per Deployment" limit on Vercel? I'm using Next.js with next-intl (de + en) which creates 3 routes per page, so I'm quickly exceeding Vercel's limit.

I've tried reducing routes through server-side pre-rendering and read that the limit can somehow be bypassed with the use of the Edge Config, which, however, seems to have an absolute usage limit itself (on the hobby tier).

But so far, I've not found a really sustainable solution to create virtually limitless pages. Is that even possible? And why does Vercel have such a limit anyways, makes hosting a blog-like website there kind of pointless, doesn't it?

Has anyone found a good solution to this problem and/or could help me find one? 🙂
Thanks a lot for your help!
Answered by joulev
If you don’t have generateStaticParams, how do you have that many routes? Don’t tell me you have hundreds of page.tsx files inside your app directory…
View full answer

13 Replies

Olive-sided Flycatcher
I'm also interested in this. Doesn't handling additional routes with dynamicParams come with significant trade-offs in terms of performance and SEO or am I missing something?
@Olive-sided Flycatcher I'm also interested in this. Doesn't handling additional routes with dynamicParams come with significant trade-offs in terms of performance and SEO or am I missing something?
performance: not significant. only the very first requests to the page are affected. once the page is fully built and stored in the cache, all requests to it are as fast as to any static routes.

SEO: no problems. if a crawler is the first visitor to a page, all it has to do is to wait a few more hundred milliseconds maybe. it still gets to see all the data that it would get for a static route.
Answer
@joulev If you don’t have generateStaticParams, how do you have that many routes? Don’t tell me you have hundreds of page.tsx files inside your app directory…
Brewer's BlackbirdOP
I won't tell you then 🙈 Got it to work a few minutes ago, and yes, I misunderstood some core concepts significantly. Thanks for your patience 😇
Since I think the limit is a hard limit and there isn’t anything you can do about it
@joulev Uhhh… wha <:miku_what:853443420948004905> If you did have hundreds of page.tsx files, how did you get it to work?
Brewer's BlackbirdOP
Exactly by replacing all named folders containing a page.tsx, by a dynamic [slug] folder. Just feel very stupid rn, but I guess I've learned a lot along the way 😬
Oh I see… wow, this is the first time I’ve seen someone doing all that
@joulev Oh I see… wow, this is the first time I’ve seen someone doing all that
Brewer's BlackbirdOP
😂 🤦‍♂️ Anyways, thanks a lot for your help and it's amazing how quickly you responded! ❤️
You re welcome, happy coding