I am getting the warning for Error Page, and i didn't use any translation in Error Page.
Warn: You have not declared a namespacesRequired array on your page-level component: Error. This will cause all namespaces to be sent down to the client, possibly negatively impacting the performance of your app. For more info, see: https://github.com/isaachinman/next-i18next#4-declaring-namespace-dependencies
I tried to define namespacesRequired in Error Page, but next.js _error.js would override the returned parameter
0.37.0
with appWithTranslation(myApp) in _app.js, Navigate to Error Page, and the above warning will appear, even with namespacesRequired defined.
The Warning is not expected.
N/A
MBP 2017
Add any other context about the problem here.
That's exactly right. It's warning/reminding you to translate your error page.
Wait a minute. Error page is provided by Next.JS framework. How can you change a framework built-in error page? and what else we don't have control over.
We need way to stop this incessant warning, because there is something we don't care much about content (like error page)
You have not declared a namespacesRequired array on your page-level component: ErrorPage. This will cause all namespaces to be sent down to the client, possibly negatively impacting the performance of your app. For more info, see: https://github.com/isaachinman/next-i18next#4-declaring-namespace-dependencies
You have not declared a namespacesRequired array on your page-level component: ErrorPage. This will cause all namespaces to be sent down to the client, possibly negatively impacting the performance of your app. For more info, see: https://github.com/isaachinman/next-i18next#4-declaring-namespace-dependencies
You have not declared a namespacesRequired array on your page-level component: ErrorPage. This will cause all namespaces to be sent down to the client, possibly negatively impacting the performance of your app. For more info, see: https://github.com/isaachinman/next-i18next#4-declaring-namespace-dependencies
@timph Feel free to:
next-i18next documentation thoroughlystrictMode in your configI did.
The documentation for strictMode is not in
https://github.com/isaachinman/next-i18next#options
I found it in type.ds
@timph Ah, fair point. Added with #407. In general it's quite easy to mess up the SSR localisation process without realising, so we try to provide as many useful warnings as possible to devs. The idea with the error page is that it is a pretty poor user experience to be given error feedback in a different language.
Also worth saying that we don't specifically check against the error page, but will warn you when you don't declare namespacesRequired on _any_ page. You always have the option to disable the warnings, though.
I appreciate it, Isaac!
Thanks @isaachinman and @timph ,
Adding a pages/_error.js with namespacesRequired work fine for me.
Tho the NextJS doc say,
鈿狅笍 The pages/_error.js component is only used in production. In development you get an error with call stack to know where the error originated from. 鈿狅笍
Most helpful comment
@timph Ah, fair point. Added with #407. In general it's quite easy to mess up the SSR localisation process without realising, so we try to provide as many useful warnings as possible to devs. The idea with the error page is that it is a pretty poor user experience to be given error feedback in a different language.
Also worth saying that we don't specifically check against the error page, but will warn you when you don't declare
namespacesRequiredon _any_ page. You always have the option to disable the warnings, though.