{"record":{"id":"b801a9ced64b5620","repo":"leptos-rs/leptos","slug":"positional-argument-follows-keyword-argument","errorCode":null,"errorMessage":"positional argument follows keyword argument","messagePattern":"positional argument follows keyword argument","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server_fn_macro/src/lib.rs","lineNumber":1189,"sourceCode":"                    } else if key == \"impl_from\" {\n                        if impl_from.is_some() {\n                            return Err(syn::Error::new(\n                                key.span(),\n                                \"keyword argument repeated: `impl_from`\",\n                            ));\n                        }\n                        impl_from = Some(stream.parse()?);\n                    } else if key == \"impl_deref\" {\n                        if impl_deref.is_some() {\n                            return Err(syn::Error::new(\n                                key.span(),\n                                \"keyword argument repeated: `impl_deref`\",\n                            ));\n                        }\n                        impl_deref = Some(stream.parse()?);\n                    } else if key == \"protocol\" {\n                        if protocol.is_some() {\n                            return Err(syn::Error::new(\n                                key.span(),\n                                \"keyword argument repeated: `protocol`\",\n                            ));\n                        }\n                        protocol = Some(stream.parse()?);\n                    } else {\n                        return Err(lookahead.error());\n                    }\n                } else {\n                    let value = key_or_value;\n                    if use_key_and_value {\n                        return Err(syn::Error::new(\n                            value.span(),\n                            \"positional argument follows keyword argument\",\n                        ));\n                    }\n                    if arg_pos == 1 {\n                        struct_name = Some(value)","sourceCodeStart":1171,"sourceCodeEnd":1207,"githubUrl":"https://github.com/leptos-rs/leptos/blob/32d20f6c9d517451d77beb68d88c7716823dac41/server_fn_macro/src/lib.rs#L1171-L1207","documentation":"The `protocol` keyword is also single-use; a second `protocol = ...` in the #[server] attribute triggers this error at the repeated key's span. The parser treats each known option as set-once to prevent ambiguous overrides.","triggerScenarios":"#[server(protocol = \"grpc\", protocol = \"grpc-web\")]; combining a protocol line from one attribute with another attribute's options; templated generation that always appends `protocol`.","commonSituations":"Migrating between protocol settings (e.g. switching protocols) where the old line was commented as code rather than removed; bulk edits across many server functions.","solutions":["Keep only one `protocol = ...` argument in the attribute.","Remove the obsolete protocol value instead of appending the new one next to it.","Search the attribute for all occurrences of `protocol` before editing."],"exampleFix":"// before\n#[server(protocol = \"grpc\", protocol = \"grpc-web\")]\n// after\n#[server(protocol = \"grpc-web\")]","handlingStrategy":"validation","validationCode":"let attr = \"#[server(protocol = \\\"grpc\\\", protocol = \\\"grpc-web\\\")]\";\nassert!(attr.matches(\"protocol\").count() <= 1, \"duplicate `protocol`\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Replace (not append) protocol settings during migration","Keep protocol config centralized in one macro per function","Review generated code for repeated keys"],"tags":["rust","proc-macro","parse-error","duplicate-argument"],"backgroundTag":"duplicate-keyword-argument","analyzedSha":"32d20f6c9d517451d77beb68d88c7716823dac41","analyzedAt":"2026-09-01T18:55:42.580Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T01:17:15.007Z"}