Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixes sentry errors on 404's pages #6144

Merged
merged 11 commits into from
Nov 29, 2023
Prev Previous commit
Next Next commit
meta: use async function for layout
  • Loading branch information
ovflowd committed Nov 29, 2023
commit 546c024a28684e7e80f2e2b11e9189315bd42a93
6 changes: 3 additions & 3 deletions app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Analytics } from '@vercel/analytics/react';
import { Source_Sans_3 } from 'next/font/google';
import { useLocale } from 'next-intl';
import { getLocale } from 'next-intl/server';
import type { FC, PropsWithChildren } from 'react';

import BaseLayout from '@/layouts/BaseLayout';
@@ -17,8 +17,8 @@ const sourceSans = Source_Sans_3({
subsets: ['latin'],
});

const RootLayout: FC<PropsWithChildren> = ({ children }) => {
const locale = useLocale();
const RootLayout: FC<PropsWithChildren> = async ({ children }) => {
const locale = await getLocale();

const { langDir, hrefLang } = availableLocalesMap[locale] || defaultLocale;

2 changes: 0 additions & 2 deletions app/[locale]/not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use client';

import { useTranslations } from 'next-intl';
import type { FC } from 'react';

Loading