{"record":{"id":"8e28ffa81415f36c","repo":"DioxusLabs/dioxus","slug":"keyword-argument-repeated-endpoint","errorCode":null,"errorMessage":"keyword argument repeated: `endpoint`","messagePattern":"keyword argument repeated: `endpoint`","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"packages/fullstack-macro/src/lib.rs","lineNumber":1582,"sourceCode":"                    } else if key == \"prefix\" {\n                        if prefix.is_some() {\n                            return Err(syn::Error::new(\n                                key.span(),\n                                \"keyword argument repeated: `prefix`\",\n                            ));\n                        }\n                        prefix = Some(stream.parse()?);\n                    } else if key == \"encoding\" {\n                        if encoding.is_some() {\n                            return Err(syn::Error::new(\n                                key.span(),\n                                \"keyword argument repeated: `encoding`\",\n                            ));\n                        }\n                        encoding = Some(stream.parse()?);\n                    } else if key == \"endpoint\" {\n                        if fn_path.is_some() {\n                            return Err(syn::Error::new(\n                                key.span(),\n                                \"keyword argument repeated: `endpoint`\",\n                            ));\n                        }\n                        fn_path = Some(stream.parse()?);\n                    } else if key == \"input\" {\n                        if encoding.is_some() {\n                            return Err(syn::Error::new(\n                                key.span(),\n                                \"`encoding` and `input` should not both be \\\n                                 specified\",\n                            ));\n                        } else if input.is_some() {\n                            return Err(syn::Error::new(\n                                key.span(),\n                                \"keyword argument repeated: `input`\",\n                            ));\n                        }","sourceCodeStart":1564,"sourceCodeEnd":1600,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/393d190a801ccb441d41923e232289b4f8a5c669/packages/fullstack-macro/src/lib.rs#L1564-L1600","documentation":"`endpoint` sets a custom URL/endpoint for a `#[server]` function and may appear at most once. A second `endpoint = ...` is rejected by the keyword parser (packages/fullstack-macro/src/lib.rs:1580-1586).","triggerScenarios":"`#[server(endpoint = \"https://a.dev/api\", endpoint = \"https://b.dev/api\")]`; environment-driven copy-paste where a dev and a prod endpoint both got left in; combining `prefix`-style configuration with an extra `endpoint` override and duplicating it.","commonSituations":"Switching deployed environments by editing the attribute and forgetting the old value; merge conflicts; scaffolding scripts that append configuration instead of replacing.","solutions":["Keep exactly one `endpoint = ...` value (use a `const` string if you switch environments).","For per-environment endpoints, prefer a runtime `server_fn::client!()`/URL override or Cargo feature/cfg instead of editing the attribute per build.","After scaffolding or merges, scan the attribute for repeated keys."],"exampleFix":"// before\n#[server(endpoint = \"http://localhost:8080/api\", endpoint = \"https://prod.example.com/api\")]\nasync fn load() -> Data { ... }\n\n// after\nconst ENDPOINT: &str = if cfg!(debug_assertions) { \"http://localhost:8080/api\" } else { \"https://prod.example.com/api\" };\n#[server(endpoint = ENDPOINT)]\nasync fn load() -> Data { ... }","handlingStrategy":"validation","validationCode":"# Reuse the duplicate-key checker from index 93; endpoint is in its key list.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Store endpoints in consts selected by cfg/cfg!(debug_assertions) instead of editing the attribute per environment.","Prefer one endpoint override at the client setup level when possible, not per function."],"tags":["dioxus","proc-macro","server-functions","macro-args","compile-time"],"backgroundTag":null,"analyzedSha":"393d190a801ccb441d41923e232289b4f8a5c669","analyzedAt":"2026-08-16T11:27:45.815Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}