{"record":{"id":"a2de8fd48ed020fe","repo":"leptos-rs/leptos","slug":"keyword-argument-repeated-client","errorCode":null,"errorMessage":"keyword argument repeated: `client`","messagePattern":"keyword argument repeated: `client`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server_fn_macro/src/lib.rs","lineNumber":1149,"sourceCode":"                        }\n                        input_derive = Some(stream.parse()?);\n                    } else if key == \"output\" {\n                        if encoding.is_some() {\n                            return Err(syn::Error::new(\n                                key.span(),\n                                \"`encoding` and `output` should not both be \\\n                                 specified\",\n                            ));\n                        } else if output.is_some() {\n                            return Err(syn::Error::new(\n                                key.span(),\n                                \"keyword argument repeated: `output`\",\n                            ));\n                        }\n                        output = Some(stream.parse()?);\n                    } else if key == \"server\" {\n                        if server.is_some() {\n                            return Err(syn::Error::new(\n                                key.span(),\n                                \"keyword argument repeated: `server`\",\n                            ));\n                        }\n                        server = Some(stream.parse()?);\n                    } else if key == \"client\" {\n                        if client.is_some() {\n                            return Err(syn::Error::new(\n                                key.span(),\n                                \"keyword argument repeated: `client`\",\n                            ));\n                        }\n                        client = Some(stream.parse()?);\n                    } else if key == \"custom\" {\n                        if custom_wrapper.is_some() {\n                            return Err(syn::Error::new(\n                                key.span(),\n                                \"keyword argument repeated: `custom`\",","sourceCodeStart":1131,"sourceCodeEnd":1167,"githubUrl":"https://github.com/leptos-rs/leptos/blob/32d20f6c9d517451d77beb68d88c7716823dac41/server_fn_macro/src/lib.rs#L1131-L1167","documentation":"This error occurs when the `client` keyword argument is repeated in a #[server] attribute. `client` overrides the client-side calling logic; a second value is ambiguous, so the macro's token-stream parser fails compilation with a span on the repeated key.","triggerScenarios":"Writing #[server(client = path1, client = path2)] in one attribute, or a macro wrapper injecting `client` when the user already provided one.","commonSituations":"Copy-paste of attribute args, refactoring the client override without deleting the old entry, generated macro layers that each add client.","solutions":["Keep only one `client = ...` entry.","Remove `client` entirely to use the default generated client.","Fix macro wrappers to add `client` only when absent."],"exampleFix":"// before\n#[server(client = my_client::run, client = other::run)]\nasync fn save(data: String) -> Result<(), ServerFnError> { todo!() }\n\n// after\n#[server(client = my_client::run)]\nasync fn save(data: String) -> Result<(), ServerFnError> { todo!() }","handlingStrategy":"validation","validationCode":"// Pre-commit check for duplicate `client` args:\n// grep -rnE '#\\[server\\([^)\\n]*client\\s*=[^)\\n]*client\\s*=' src/ && exit 1 || exit 0","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Specify `client = ...` at most once per attribute.","Edit in place when changing the client override; do not append.","Check macro wrapper layers for unconditional client injection.","Catch duplicates with cargo check in a pre-commit or CI step."],"tags":["rust","proc-macro","compile-time","server-fn"],"backgroundTag":"duplicate-macro-attribute-argument","analyzedSha":"32d20f6c9d517451d77beb68d88c7716823dac41","analyzedAt":"2026-09-01T18:55:42.580Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T01:17:15.007Z"}