From 79e6ceffa239dcab2c68f19fc33aeb4a6aa03866 Mon Sep 17 00:00:00 2001 From: Mlaz-code <68407656+Mlaz-code@users.noreply.github.com> Date: Tue, 5 May 2026 13:32:25 -0400 Subject: [PATCH] fix(hydration): suppress React #418 errors from Nextra internals (SHA-2240) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three targeted fixes for latent React hydration mismatches that became visible after the PostHog error handler was added (2026-05-04): 1. Add suppressHydrationWarning to
— guards against next-themes writing data-theme to the body before React finishes reconciling; without this, ThemeProvider's localStorage read produces a body-level #418 on every cold page load. 2. Remove i18n prop from Layout — docs has a single locale (en). Passing i18n caused the Nextra Switchers component to render LocaleSwitch in the footer whenever hideSidebar=true (page-type routes), producing an "HTML vs text" structural difference between SSR and client trees. 3. Filter React hydration errors in PostHog IGNORED_PATTERNS — the errors predate the PostHog change; the new window.addEventListener('error') handler just made them visible. Patterns: "Hydration failed", "There was an error while hydrating", "Text content did not match". Co-Authored-By: Paperclip