{"record":{"id":"3ce8dfbf088f3dd4","repo":"DioxusLabs/dioxus","slug":"literal-in-deprecated-value-must-be-a-string","errorCode":null,"errorMessage":"literal in `deprecated` value must be a string","messagePattern":"literal in `deprecated` value must be a string","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core-macro/src/component.rs","lineNumber":449,"sourceCode":"        })\n        .fold(String::new(), |mut doc, next_doc_line| {\n            doc.push('\\n');\n            doc.push_str(&next_doc_line);\n            doc\n        });\n\n    Some(DocField {\n        arg_name: &pt.pat,\n        arg_type: &pt.ty,\n        deprecation: pt.attrs.iter().find_map(|attr| {\n            if !attr.path().is_ident(\"deprecated\") {\n                return None;\n            }\n\n            let res = crate::utils::DeprecatedAttribute::from_meta(&attr.meta);\n\n            match res {\n                Err(e) => panic!(\"{}\", e.to_string()),\n                Ok(v) => Some(v),\n            }\n        }),\n        input_arg_doc: arg_doc,\n    })\n}\n\nfn validate_component_fn(item_fn: &ItemFn) -> Result<()> {\n    // Do some validation....\n    // 1. Ensure the component returns *something*\n    if item_fn.sig.output == ReturnType::Default {\n        return Err(Error::new(\n            item_fn.sig.output.span(),\n            \"Must return a <dioxus_core::Element>\".to_string(),\n        ));\n    }\n\n    // 2. make sure there's no lifetimes on the component - we don't know how to handle those","sourceCodeStart":431,"sourceCodeEnd":467,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/core-macro/src/component.rs#L431-L467","documentation":"While collecting a component's doc fields, the core macro found a #[deprecated] attribute whose value meta could not be parsed by DeprecatedAttribute::from_meta — the attribute's value must be a string literal. The panic surfaces the parse error string from the proc macro.","triggerScenarios":"Thrown at packages/core-macro/src/component.rs:449 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Write the deprecated attribute with a string literal, e.g. #[deprecated = 'use other instead']."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"24f6a829df0dfa203961a98ea4cae21c2ff27e28","analyzedAt":"2026-08-23T07:10:14.078Z","contentChangedAt":"2026-08-23T07:10:14.078Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}