From 891bc3ff5f2a78e5aa6ac09be212b70f286d0864 Mon Sep 17 00:00:00 2001 From: Vaclav Dvorak Date: Sat, 20 Jun 2026 15:59:51 +0200 Subject: [PATCH] feat(core): warn in dev when SSR styles are rehydrated more than once MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit renderToStyleElements returns the renderer's entire accumulated CSS on every call. In the Next.js App Router, useServerInsertedHTML runs once per streaming flush, so a setup that does not clear the renderer between flushes re-emits the full stylesheet and the copies are streamed into . Those stale copies override styles inserted after a client-side navigation, silently breaking makeStyles overrides (they lose to their makeResetStyles base). The failure looks correct on a hard reload and only appears after a soft navigation, which makes it very hard to diagnose. rehydrateRendererCache scans every server-rendered