Hydration Mismatch with wasm-split + SSR: Route component renders twice (duplication) #5287
Replies: 1 comment 1 reply
|
@dolto this is a confirmed bug tracked in #4631. root cause: the server and client see split components differently during hydration. on the server (not wasm32), the on the client (wasm32), the router macro wraps the component in a so the client's VDOM has a suspended placeholder where the server has full content. the hydration node mapping is misaligned. once the chunk loads and the streaming hydration path ( workaround: remove you can also wrap a rsx! {
SuspenseBoundary {
fallback: |_| rsx! { "loading..." },
Outlet::<BlogRoute> {}
}
}ref: #4631 (same bug) | wasm-split PR #3683 | #5062 (wasm-split issues in 0.7) |


@dolto this is a confirmed bug tracked in #4631.
wasm-split+ fullstack SSR has never been tested together (the test harness atpackages/playwright-tests/wasm-split-harnessis client-only, no fullstack features).root cause: the server and client see split components differently during hydration.
on the server (not wasm32), the
maybe_wasm_split!macro inconfig-macros/src/lib.rstakes the else branch and renders the component synchronously. your fullHomeHTML is in the SSR response.on the client (wasm32), the router macro wraps the component in a
LazyLoaderthat callsuse_resource(|| async { MODULE.load().await }).suspend(). during the initialvirtual_dom.rebuild()withskip_mutations =…