DioxusLabs/dioxus · error · syn::Error

expected string literal

Error message

expected string literal

What it means

Error "expected string literal" thrown in DioxusLabs/dioxus.

Source

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

                                "keyword argument repeated: `protocol`",
                            ));
                        }
                        protocol = Some(stream.parse()?);
                    } else {
                        return Err(lookahead.error());
                    }
                } else {
                    let value = key_or_value;
                    if use_key_and_value {
                        return Err(syn::Error::new(
                            value.span(),
                            "positional argument follows keyword argument",
                        ));
                    }
                    if arg_pos == 1 {
                        struct_name = Some(value)
                    } else {
                        return Err(syn::Error::new(value.span(), "expected string literal"));
                    }
                }
            } else if lookahead.peek(LitStr) {
                if use_key_and_value {
                    return Err(syn::Error::new(
                        stream.span(),
                        "If you use keyword arguments (e.g., `name` = \
                         Something), then you can no longer use arguments \
                         without a keyword.",
                    ));
                }
                match arg_pos {
                    1 => return Err(lookahead.error()),
                    2 => prefix = Some(stream.parse()?),
                    3 => encoding = Some(stream.parse()?),
                    4 => fn_path = Some(stream.parse()?),
                    _ => return Err(syn::Error::new(stream.span(), "unexpected extra argument")),
                }

View on GitHub (pinned to 393d190a80)

When it happens

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