{"record":{"id":"11bea644204d298e","repo":"DioxusLabs/dioxus","slug":"lifetimes-are-not-supported-in-components","errorCode":null,"errorMessage":"Lifetimes are not supported in components","messagePattern":"Lifetimes are not supported in components","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"packages/core-macro/src/component.rs","lineNumber":469,"sourceCode":"            }\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\n    if item_fn.sig.generics.lifetimes().count() > 0 {\n        return Err(Error::new(\n            item_fn.sig.generics.span(),\n            \"Lifetimes are not supported in components\".to_string(),\n        ));\n    }\n\n    // 3. we can't handle async components\n    if item_fn.sig.asyncness.is_some() {\n        return Err(Error::new(\n            item_fn.sig.asyncness.span(),\n            \"Async components are not supported\".to_string(),\n        ));\n    }\n\n    // 4. we can't handle const components\n    if item_fn.sig.constness.is_some() {\n        return Err(Error::new(\n            item_fn.sig.constness.span(),\n            \"Const components are not supported\".to_string(),","sourceCodeStart":451,"sourceCodeEnd":487,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/393d190a801ccb441d41923e232289b4f8a5c669/packages/core-macro/src/component.rs#L451-L487","documentation":"Error \"Lifetimes are not supported in components\" thrown in DioxusLabs/dioxus.","triggerScenarios":"Thrown at packages/core-macro/src/component.rs:469 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"393d190a801ccb441d41923e232289b4f8a5c669","analyzedAt":"2026-08-16T11:27:45.815Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}