DioxusLabs/dioxus · error · syn::Error

Cannot have multiple query parameters when one is a…

Error message

Cannot have multiple query parameters when one is a catch-all

What it means

A route declared more than one query parameter while at least one of them is a catch-all ({?:..rest}). A catch-all consumes the entire query string, so combining it with other query bindings is ambiguous and rejected at macro expansion time.

Solutions

  1. Keep only the catch-all query parameter, or remove the catch-all so multiple named query parameters can be used.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/fullstack-macro/src/lib.rs:717 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/c6356c302db75f6f. Report an issue: GitHub.

Appendix: source

Thrown at packages/fullstack-macro/src/lib.rs:717

                    param.binding.span(),
                    format!(
                        "query parameter `{}` not found in function arguments",
                        param.binding
                    ),
                )
            })?;
            query_params.push(QueryParam {
                binding: ident,
                name: param.name,
                catch_all: param.catch_all,
                ty: ty.0,
                arg_idx: ty.1,
            });
        }

        // Disallow multiple query params if one is a catch-all
        if query_params.iter().any(|param| param.catch_all) && query_params.len() > 1 {
            return Err(syn::Error::new(
                Span::call_site(),
                "Cannot have multiple query parameters when one is a catch-all",
            ));
        }

        if let Some(options) = route.oapi_options.as_mut() {
            options.merge_with_fn(function)
        }

        let method = match (method_from_macro, route.method) {
            (Some(method), None) => method,
            (None, Some(method)) => method,
            (Some(_), Some(_)) => {
                return Err(syn::Error::new(
                    Span::call_site(),
                    "HTTP method specified both in macro and in attribute",
                ));
            }

View on GitHub (pinned to 24f6a829df)