{"record":{"id":"cb693e2d752e47c3","repo":"DioxusLabs/dioxus","slug":"cannot-serialize-attribute-value","errorCode":null,"errorMessage":"Cannot serialize attribute value","messagePattern":"Cannot serialize attribute value","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/mutations.rs","lineNumber":434,"sourceCode":"    /// Remove the top stack node from the renderer tree.\n    Remove,\n}\n\n/// A static list of mutations that can be applied to the DOM. Note: this list does not contain any `Any` attribute values\n#[derive(Debug, PartialEq, Default)]\npub struct Mutations {\n    /// Any mutations required to patch the renderer to match the layout of the VirtualDom\n    pub edits: Vec<Mutation>,\n}\n\nfn serializable_attribute_value(value: &AttributeValue) -> AttributeValue {\n    match value {\n        AttributeValue::Text(_)\n        | AttributeValue::Bool(_)\n        | AttributeValue::Float(_)\n        | AttributeValue::Int(_)\n        | AttributeValue::None => value.clone(),\n        _ => panic!(\"Cannot serialize attribute value\"),\n    }\n}\n\nmacro_rules! collect_field_mutations {\n    ($($method:ident($field:ident: $field_ty:ty) => $variant:ident;)*) => {\n        $(\n            fn $method(&mut self, $field: $field_ty) {\n                self.edits.push(Mutation::$variant { $field })\n            }\n        )*\n    };\n}\n\nmacro_rules! collect_string_mutations {\n    ($($method:ident($field:ident) => $variant:ident;)*) => {\n        $(\n            fn $method(&mut self, $field: &str) {\n                self.edits.push(Mutation::$variant {","sourceCodeStart":416,"sourceCodeEnd":452,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/core/src/mutations.rs#L416-L452","documentation":"While converting attribute values for serializable Mutations, an attribute value type that cannot be serialized (such as an Any or external listener marker) was encountered. This guard indicates a non-serializable AttributeValue reached a serialization path that only supports text, bool, float, and similar plain values.","triggerScenarios":"Thrown at packages/core/src/mutations.rs:434 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use an attribute value type that can be serialized (string, number, bool, or serializable types). Convert custom values to strings before setting the attribute."],"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-14T00:17:10.932Z"}