Next.js website crashes on Vercel after an x amount of hours

Hey,

I have a very strange problem. I have a website running on Vercel and it worked completely fine for the past 2 years. A few days back the problems started. The website started crashing without me changing the code for it at all. It uses Next.js and next-intl to redirect from “/” to “/bg” if no language has been provided at first.

I added next-intl as I had my own implementation for translations (which did absolutely the same as next-intl), but decided to tryout next-intl as I thought this might’ve been my issue.

The website just randomly decides to crash and it shows the static Next.js error: “Application error: a client-side exception has occurred (see the browser console for more information)”. There isn’t much happening in the console though. There is just one error: “Too many calls to Location or History APIs within a short timeframe”. There is a strange behaviour before crashing as well. When you visit the site it goes into a redirect loop and redirects from root to a language, then again to root, then language.

In order for the website to start running again, I just redeploy it and it works for at least 3 to 12 hours.

IMO this really looks like a Vercel issue. I am considering switching to CF if things doesn’t sort out in the next few days.

What could’ve went wrong?

Hi @ivanvladimirov, welcome to the Vercel Community!

Sorry that you’re facing this issue. The issue seems related to some client side issues but very hard to narrow down without looking at the code.

Can you please share your public repo or a minimal reproducible example. That will let us all work together from the same code to figure out what’s going wrong?

Hey, yes, sorry.

This is the repo.

1 Like

I just removed the i18n routing as I think this was the issue before. Will keep you in touch.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.