Nested routes at site root cause 404 error with actix-web #2030
-
Hi dear Greg, sorry for reaching out again:confounded: In a specific scenario I want to use nested routes at site root. However if my website was built in SSR mode, the error occurs: To reproduce it, you may utilize the repo's #[component]
pub fn TodoApp() -> impl IntoView {
provide_meta_context();
view! {
<Link rel="shortcut icon" type_="image/ico" href="/favicon.ico"/>
<Stylesheet id="leptos" href="/pkg/todo_app_sqlite.css"/>
<Router>
<header>
<h1>"My Tasks"</h1>
</header>
<main>
<Routes>
<Route path="" view=move || {
// Always show the child at last
view! { <Todos/><Outlet/>}
}>
<Route path=":id" view=move || {view! { <p>iiii</p> }}/>
</Route>
</Routes>
</main>
</Router>
}
} Then navigating to the site root will result in a The similar nested routes in the I've observed that the error message |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You do not have a fallback Route path="" at the nested level so See a bit more here https://leptos-rs.github.io/leptos/router/17_nested_routing.html#nested-routes-as-layout |
Beta Was this translation helpful? Give feedback.
You do not have a fallback Route path="" at the nested level so
/:id
is the only complete path it will matchSee a bit more here https://leptos-rs.github.io/leptos/router/17_nested_routing.html#nested-routes-as-layout