i18nexus / next-i18n-router

Next.js App Router internationalized routing and locale detection.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

localeDetector spamming warning

Kirill-Ponomarenko opened this issue · comments

I'm getting thousands of warnings in the logs:

Reverting to using defaultLocale: en
No valid locales in accept-language header: *

To my understanding it comes from here: https://github.com/i18nexus/next-i18n-router/blob/main/src/localeDetector.ts#L18C5-L18C78

But from user's perspective everything works fine. And I actually don't have so much visits.
Is there a way to disable this warnings?

That's interesting that you would be getting thousands of these warnings. This only occurs when a a visitor does not have a valid language header on their request. According to your warning, it appears that thousands of visitors accessing your website have an accept-language header of *. Most of the time this type of language header means a bot is accessing your website. You may be getting inundated by bot requests.

Regardless, it probably is not useful to have this warning since there is nothing you can do as a developer to affect the headers of incoming requests. We'll implement a patch to remove the warning.

Most likely some infrastructure calls, because our site blocked from the internet.

Thanks, will wait for this update!

I just came here for the exact same reason. Thanks for pointing that out

I think it may be next/link prefetch. We have a lot of links on one page and it can generate 16 requests at a time

Console warning removed in v5.4.3 👍

Appreciate how quickly you took care of it, thanks