DioxusLabs/dioxus · error

{err}

Error message

{err}

What it means

Router::current failed to parse the current URL into the requested Routable type. Either the child-route mapping failed to resolve the absolute route, or R::from_str rejected the full route string; the wrapped error string is surfaced verbatim.

Source

Thrown at packages/router/src/contexts/router.rs:278

    /// The route that is currently active.
    pub fn current<R: Routable>(&self) -> R {
        let absolute_route = self.full_route_string();
        // If this is a child route, map the absolute route to the child route before parsing
        let mapping = consume_child_route_mapping::<R>();
        let route = match mapping.as_ref() {
            Some(mapping) => mapping
                .parse_route_from_root_route(&absolute_route)
                .ok_or_else(|| "Failed to parse route".to_string()),
            None => {
                R::from_str(&absolute_route).map_err(|err| format!("Failed to parse route {err}"))
            }
        };

        match route {
            Ok(route) => route,
            Err(err) => {
                dioxus_core::throw_error(ParseRouteError { message: err });
                "/".parse().unwrap_or_else(|err| panic!("{err}"))
            }
        }
    }

    /// The full route that is currently active. If this is called from inside a child router, this will always return the parent's view of the route.
    pub fn full_route_string(&self) -> String {
        let inner = self.inner.read();
        inner.subscribe_to_current_context();
        let history = history();
        history.current_route()
    }

    /// The prefix that is currently active.
    pub fn prefix(&self) -> Option<String> {
        let history = history();
        history.current_prefix()
    }

View on GitHub (pinned to 24f6a829df)

Solutions

  1. The router reported the embedded error. Fix the failing navigation, route parsing, or external redirect it describes.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at packages/router/src/contexts/router.rs:278 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of DioxusLabs/dioxus@24f6a829df (2026-08-23). Data as JSON: /api/errors/07a2b20d2da7b6d7. Report an issue: GitHub.