DioxusLabs/dioxus · error
expected string literal
Error message
expected string literal
What it means
A positional argument to the #[server] macro at a position where a string literal (the server function name) is expected was not a string literal. Only the first positional argument is accepted, and it must be a quoted name.
Solutions
- Pass a string literal in this position, e.g. name = "MyEndpoint".
Defensive patterns
Strategy: validation
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@24f6a829df (2026-08-23).
Data as JSON: /api/errors/069fda93a040ecde.
Report an issue: GitHub.
Appendix: 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 24f6a829df)