my changeLanguage function is not working in production. Using the debug functionality of i18n i do not have any warning, more so the language change is detected correctly each time i click on the select menu. i have log locale on the console and it returns undefined Can someone explain to me what i do wrong, please? See below my changeLanguage
const changeLanguage = (e) => {
const locale = e.target.value;
i18n.changeLanguage(locale);
router.push(router.pathname, router.asPath, { locale });
};