Leptos 0.8.12 NestedRoutesView Hydration Error #4456
-
IssueHydration error in NestedRoutesView with multi-app Axum setup Error MessageA hydration error occurred while trying to hydrate an element defined at src/apps/app_a/app.rs:29:118 The framework expected a text node, but found this instead: JSHandle@node Stack: Environment
SetupMultiple isolated Leptos apps mounted at different Axum routes: // main.rs - Axum level
.nest("/app-a", app_a_routes) // Leptos Instance 1
.nest("/app-b", app_b_routes) // Leptos Instance 2Each app has its own starting at relative paths. Code#[component]
pub fn AppA() -> impl IntoView {
view! {
<Router>
<Navigation />
<main>
<Routes fallback=|| view! { <div>"404"</div> }>
<Route path=StaticSegment("") view=|| view! { <Homepage/> }/>
<Route path=StaticSegment("about") view=|| view! {
<Layout title="About"><About /></Layout>
}/>
</Routes>
</main>
<Footer />
</Router>
}
}Attempted Solutions (All Failed)✅ Routes fallback: QuestionIs this a known limitation when mounting Leptos at non-root paths (/app-a/*)? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
The Router has a |
Beta Was this translation helpful? Give feedback.
i.e., you need to set the
Router baseon the client and, I suppose in this case, to not set it on the server. When you land at/app-a/aboutthe client side is looking for an/app-a/aboutroute, which does not exist in the route definitions, and is therefore trying to hydrate the fallback; whereas your server has renderedAbout