Failed to parse route Route did not match: Attempted Matches:
Problem I'm experimenting with the router and i have the following setup:
#[derive(Debug, Clone, Routable, PartialEq)]
#[rustfmt::skip]
enum Route {
#[route("/auth")]
Auth {},
#[route("/:..segments")]
NotFound { segments: Vec<String> },
}
So I don't have the default root route "/" and a fallback page. When I try to access the page "/" I get the following error:
Failed to parse route Route did not match: Attempted Matches:
Steps To Reproduce
Steps to reproduce the behavior:
- Create minimal router example
- Remove the default root route "/" and add a fallback route
- access the route "/" in the webbrowser
Expected behavior
I would expect that the router matches the "NotFound" route
Screenshots
Environment:
- Dioxus version: 0.7.2 Web + Fullstack
- Rust version: 1.91.1
- OS info: Windows 11
- App platform: Chrome
What would you expect to render if NotFound was rendered correctly? I see not found running the code bellow in 0.7 which is what I would expect:
use dioxus::prelude::*;
fn main() {
launch(|| rsx! {Router::<Route>{}})
}
#[derive(Debug, Clone, Routable, PartialEq)]
#[rustfmt::skip]
enum Route {
#[route("/auth")]
Auth {},
#[route("/:..segments")]
NotFound { segments: Vec<String> },
}
#[component]
fn Auth() -> Element {
rsx! {}
}
#[component]
fn NotFound(segments: Vec<String>) -> Element {
rsx! {"not found"}
}
Yes exactly, I would expect that in your example the text "not found" gets rendered
That is what I see with 0.7
ok i forgot to mention you need to enable fullstack so i could reproduce it when running your example on a bare bone project with fullstack support
When not using fullstack it works actually