dioxus icon indicating copy to clipboard operation
dioxus copied to clipboard

Failed to parse route Route did not match: Attempted Matches:

Open exellian opened this issue 2 months ago • 5 comments

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

Image

Environment:

  • Dioxus version: 0.7.2 Web + Fullstack
  • Rust version: 1.91.1
  • OS info: Windows 11
  • App platform: Chrome

exellian avatar Dec 29 '25 13:12 exellian

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"}
}

ealmloff avatar Dec 29 '25 14:12 ealmloff

Yes exactly, I would expect that in your example the text "not found" gets rendered

exellian avatar Dec 29 '25 14:12 exellian

That is what I see with 0.7

ealmloff avatar Dec 29 '25 14:12 ealmloff

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

exellian avatar Dec 29 '25 15:12 exellian

When not using fullstack it works actually

exellian avatar Dec 29 '25 15:12 exellian