diff --git a/web/app/components/base/ga/index.tsx b/web/app/components/base/ga/index.tsx index 0015edbfca..20db51d751 100644 --- a/web/app/components/base/ga/index.tsx +++ b/web/app/components/base/ga/index.tsx @@ -18,13 +18,13 @@ export type IGAProps = { gaType: GaType } -const GA: FC = ({ +const GA: FC = async ({ gaType, }) => { if (IS_CE_EDITION) return null - const nonce = process.env.NODE_ENV === 'production' ? headers().get('x-nonce') : '' + const nonce = process.env.NODE_ENV === 'production' ? (await headers()).get('x-nonce') : '' return ( <> diff --git a/web/i18n/server.ts b/web/i18n/server.ts index 2af6a4fa73..0c90658471 100644 --- a/web/i18n/server.ts +++ b/web/i18n/server.ts @@ -41,8 +41,8 @@ export const getLocaleOnServer = async (): Promise => { if (!languages.length) { // Negotiator expects plain object so we need to transform headers - const negotiatorHeaders: Record = {} - headers().forEach((value, key) => (negotiatorHeaders[key] = value)) + const negotiatorHeaders: Record = {}; + (await headers()).forEach((value, key) => (negotiatorHeaders[key] = value)) // Use negotiator and intl-localematcher to get best locale languages = new Negotiator({ headers: negotiatorHeaders }).languages() }