DioxusLabs/dioxus · error · syn::Error

Query segments should be a : followed by the name of the que

Error message

Query segments should be a : followed by the name of the query argument

What it means

Error "Query segments should be a : followed by the name of the query argument" thrown in DioxusLabs/dioxus.

Source

Thrown at packages/router-macro/src/query.rs:101

                if let Some(query_argument) = segment.strip_prefix(':') {
                    let query_ident = Ident::new(query_argument, proc_macro2::Span::call_site());
                    let field = fields.find(|(name, _)| *name == &query_ident);

                    let ty = if let Some((_, ty)) = field {
                        ty.clone()
                    } else {
                        return Err(syn::Error::new(
                            route_span,
                            format!("Could not find a field with the name '{}'", query_ident),
                        ));
                    };

                    query_arguments.push(QueryArgument {
                        ident: query_ident,
                        ty,
                    });
                } else {
                    return Err(syn::Error::new(
                        route_span,
                        "Query segments should be a : followed by the name of the query argument",
                    ));
                }
            }
            Ok(QuerySegment::Segments(query_arguments))
        }
    }
}

#[derive(Debug)]
pub struct FullQuerySegment {
    pub ident: Ident,
    pub ty: Type,
}

impl FullQuerySegment {
    pub fn parse(&self) -> TokenStream2 {

View on GitHub (pinned to 393d190a80)

When it happens

Trigger: Thrown at packages/router-macro/src/query.rs:101 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of DioxusLabs/dioxus@393d190a80 (2026-08-16). Data as JSON: /api/errors/56e707768190996c. Report an issue: GitHub.