leptos-rs / start-axum

Starter template for use with the Leptos web framework and Axum.
The Unlicense
141 stars 26 forks source link

Hydration failed in `ErrorTemplate` #18

Closed wuxianucw closed 1 year ago

wuxianucw commented 1 year ago

When some error occurs, SSR sends ErrorTemplate component while CSR always trys to render App. This leads to hydration bugs and you can see error messages like below in DevTools:

panicked at D:\data\cargo\registry\src\index.crates.io-6f17d22bba15001f\leptos_dom-0.4.8\src\html.rs:1265:13:
assertion failed: `(left == right)`
  left: `"H1"`,
 right: `"LINK"`: SSR and CSR elements have the same hydration key but different node kinds. Check out the docs for information about this kind of hydration bug: https://leptos-rs.github.io/leptos/ssr/24_hydration_bugs.html
gbj commented 1 year ago

I'm not sure how to reproduce this issue. I'd welcome either a reproduction or a PR to fix the behavior.

wuxianucw commented 1 year ago

Sorry, it seems to have been fixed. Thanks for the reply.