{"record":{"id":"4632a85556bd55b6","repo":"tauri-apps/tauri","slug":"unknown-attribute-name","errorCode":null,"errorMessage":"unknown attribute {name}","messagePattern":"unknown attribute (.+?)","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/tauri-macros/src/context.rs","lineNumber":110,"sourceCode":"                ));\n              }\n            }\n            \"assets\" => {\n              assets.replace(v.value);\n            }\n            \"test\" => {\n              if let Expr::Lit(ExprLit {\n                lit: Lit::Bool(LitBool { value, .. }),\n                ..\n              }) = v.value\n              {\n                test = value;\n              } else {\n                return Err(syn::Error::new(input.span(), \"unexpected value for test\"));\n              }\n            }\n            name => {\n              return Err(syn::Error::new(\n                input.span(),\n                format!(\"unknown attribute {name}\"),\n              ));\n            }\n          }\n        }\n        Meta::List(_) => {\n          return Err(syn::Error::new(input.span(), \"unexpected list input\"));\n        }\n      }\n\n      let _ = input.parse::<Token![,]>();\n    }\n\n    Ok(Self {\n      config_file: config_file\n        .unwrap_or_else(|| {\n          std::env::var(\"CARGO_MANIFEST_DIR\")","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/tauri-apps/tauri/blob/52e4b6e71d8632a7e648f866c442e287ecddee34/crates/tauri-macros/src/context.rs#L92-L128","documentation":"#[tauri::generate_context] has a fixed vocabulary: an optional leading string literal (the config file path), then the keys capabilities, assets and test. Any other name=value key falls into the catch-all arm and the macro stops with `unknown attribute {name}`, echoing the offending key so the typo is obvious.","triggerScenarios":"#[tauri::generate_context(config = \"tauri.conf.json\")] — the config path is written as a bare leading string literal, not a config = key; also invented keys like env, mode, source, or misspellings such as capability.","commonSituations":"Assuming a key=value API for the config path; following outdated blog posts or examples from a different tauri version; IDE completion suggesting keys that do not exist.","solutions":["Pass the config path as the first bare argument: #[tauri::generate_context(\"tauri.conf.json\")] or with no argument for the default lookup","Limit keys to capabilities, assets and test","Match examples to the exact tauri/tauri-macros version pinned in Cargo.lock"],"exampleFix":"// before\n#[tauri::generate_context(config = \"tauri.conf.json\")]\n// after\n#[tauri::generate_context(\"tauri.conf.json\")]","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only capabilities, assets and test keys exist; the config path is a leading bare string","Copy the macro invocation from the official example for your version","Treat IDE suggestions for attribute keys as unverified until they compile"],"tags":["macros","generate-context","attributes","compile-time","unknown-key"],"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"}