Error while deployment (router)

On the localhost i don’t have any problems. But while deploying a have this error about router.local

Type error: Property ‘locale’ does not exist on type ‘AppRouterInstance’.

12:52:49.370

12:52:49.370 15 | const [isScrolled, setIsScrolled] = useState(false);

12:52:49.370 16 | const router = useRouter();

12:52:49.370> 17 | console.log(“Current locale:”, router.locale);

12:52:49.370 | ^

12:52:49.371 18 |

12:52:49.371 19 | const locale = router.locale || ‘ua’;

[Deployment URL or Custom Domain:](https://luxor20.vercel.app/)

Hey @drdaria. Can you tell us more about your project? It would be helpful to know the framework and version number as well as the function code where this issue happens or a minimal reproducible example.

Based on the error you shared, it seems like the app is trying to access a property called locale that doesn’t exist on the router. If you’re using Next.js then it’s true that this property isn’t on useRouter. If you’re working with Next.js internationalization, then i18n in Edge Middleware or usePathname might be what you need.

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