diff --git a/components/page-header/LanguagePicker.tsx b/components/page-header/LanguagePicker.tsx index 0994eb24bcd6..0fb6663d729c 100644 --- a/components/page-header/LanguagePicker.tsx +++ b/components/page-header/LanguagePicker.tsx @@ -14,6 +14,12 @@ export const LanguagePicker = ({ variant }: Props) => { const langs = Object.values(languages) const selectedLang = languages[locale] + // The `router.asPath` will always be without a hash in SSR + // So to avoid a hydraration failure on the client, we have to + // normalize it to be without the hash. That way the path is treated + // in a "denormalized" way. + const routerPath = router.asPath.split('#')[0] + return ( { text: lang.nativeName || lang.name, selected: lang === selectedLang, item: ( - + {lang.nativeName ? ( <> {lang.nativeName} (