Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions app/[lang]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default async function LangLayout({ children, params }) {
<Head color={{ hue: 210 }}>
<SiteStructuredData />
</Head>
<body>
<body suppressHydrationWarning>
<PostHogProvider>
<Layout
pageMap={await getPageMap(`/${lang}`)}
Expand All @@ -64,9 +64,6 @@ export default async function LangLayout({ children, params }) {
toc={{ backToTop: true }}
feedback={{ content: null }}
editLink={null}
i18n={[
{ locale: 'en', name: 'English' },
]}
navbar={
<Navbar
logo={logo}
Expand Down
8 changes: 7 additions & 1 deletion components/PostHogProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ const IGNORED_PATTERNS = [
/ChunkLoadError/,
/Loading chunk/,
/prism_bash_exports/, // browser extension (PrismJS-based dev tools) injecting into the page
// React hydration errors (#418, #423, #425) — mismatches are from Nextra internals
// (next-themes localStorage reads, Switchers conditional rendering). Suppressed at
// the DOM level via suppressHydrationWarning; PostHog sees them as noise.
/Hydration failed/,
/There was an error while hydrating/,
/Text content did not match/,
]

function shouldIgnore(message: string): boolean {
Expand Down Expand Up @@ -111,7 +117,7 @@ function DocsEventCapture() {
return null
}

export function PostHogProvider({ children }: { children: React.ReactNode }) {
export function PostHogProvider({ children }: { children?: React.ReactNode }) {
return (
<PHProvider client={posthog}>
<DocsEventCapture />
Expand Down