{"record":{"id":"1894d8e6c9c5a167","repo":"tauri-apps/tauri","slug":"unexpected-input-expected-one-of-rename-all-r","errorCode":null,"errorMessage":"unexpected input, expected one of `rename_all`, `rename`, `root`, `async`","messagePattern":"unexpected input, expected one of `rename_all`, `rename`, `root`, `async`","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/tauri-macros/src/command/wrapper.rs","lineNumber":110,"sourceCode":"          } else if v.path.is_ident(\"root\") {\n            if let Expr::Lit(ExprLit {\n              lit: Lit::Str(s),\n              attrs: _,\n            }) = v.value\n            {\n              let lit = s.value();\n\n              wrapper_attributes.root = if lit == \"crate\" {\n                quote!($crate)\n              } else {\n                let ident = Ident::new(&lit, Span::call_site());\n                quote!(#ident)\n              };\n            }\n          }\n        }\n        WrapperAttributeKind::Meta(Meta::Path(_)) => {\n          return Err(syn::Error::new(\n            input.span(),\n            \"unexpected input, expected one of `rename_all`, `rename`, `root`, `async`\",\n          ));\n        }\n        WrapperAttributeKind::Async => {\n          wrapper_attributes.execution_context = ExecutionContext::Async;\n        }\n      }\n    }\n\n    Ok(wrapper_attributes)\n  }\n}\n\n/// The execution context of the command.\nenum ExecutionContext {\n  Async,\n  Blocking,","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/tauri-apps/tauri/blob/52e4b6e71d8632a7e648f866c442e287ecddee34/crates/tauri-macros/src/command/wrapper.rs#L92-L128","documentation":"When a #[tauri::command] attribute item parses as a bare path (a single word with no = value and no parentheses), the macro hits the Meta::Path branch. Only the bare word async is meaningful (WrapperAttributeKind::Async, switching the executor); every other bare token is rejected with 'unexpected input, expected one of rename_all, rename, root, async'.","triggerScenarios":"#[tauri::command(rename_all)] (missing = \"snake_case\"), #[tauri::command(my_flag)], or any identifier written without a value. Async commands must use the exact bare word: #[tauri::command(async)].","commonSituations":"Forgetting the = value after a key; assuming boolean flags exist (there are none besides async); typos in key names turning them into unknown bare paths.","solutions":["Give every key a value: #[tauri::command(rename_all = \"camelCase\")]","For async commands use the exact bare flag: #[tauri::command(async)]","Remove unsupported flags; the vocabulary is exactly rename_all, rename, root, async"],"exampleFix":"// before\n#[tauri::command(rename_all)]\nfn save(file_path: String) {}\n// after\n#[tauri::command(rename_all = \"camelCase\")]\nfn save(file_path: String) {} // JS: invoke('save', { filePath })","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Every key except async requires an = value","Write async commands as #[tauri::command(async)]","There are no boolean flags besides async — check spelling of key names"],"tags":["macros","command","attributes","compile-time","tauri-command"],"backgroundTag":"macro-attribute-syntax-error","analyzedSha":"52e4b6e71d8632a7e648f866c442e287ecddee34","analyzedAt":"2026-08-20T13:59:20.734Z","contentChangedAt":"2026-08-20T13:59:20.734Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}