{"record":{"id":"e9aa2f960d899889","repo":"DioxusLabs/dioxus","slug":"failed-to-serialize-sse-event","errorCode":null,"errorMessage":"Failed to serialize SSE event","messagePattern":"Failed to serialize SSE event","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/fullstack/src/payloads/sse.rs","lineNumber":318,"sourceCode":"\n            Self {\n                _marker: std::marker::PhantomData,\n                client: None,\n                keep_alive: Some(KeepAlive::new().interval(Duration::from_secs(15))),\n                sse: Some(sse),\n            }\n        }\n\n        /// Create a `ServerEvents` from a `TryStream` of events.\n        pub fn from_stream<S>(stream: S) -> Self\n        where\n            S: TryStream<Ok = T, Error = BoxError> + Send + 'static,\n            T: Serialize,\n        {\n            let stream = stream.map_ok(|event| {\n                axum::response::sse::Event::default()\n                    .json_data(event)\n                    .expect(\"Failed to serialize SSE event\")\n            });\n            let sse = axum::response::Sse::new(stream.boxed());\n            Self {\n                _marker: std::marker::PhantomData,\n                client: None,\n                keep_alive: Some(KeepAlive::new().interval(Duration::from_secs(15))),\n                sse: Some(sse),\n            }\n        }\n\n        /// Set the keep-alive configuration for the SSE connection.\n        ///\n        /// A `None` value will disable the default `KeepAlive` of 15 seconds.\n        pub fn with_keep_alive(mut self, keep_alive: Option<KeepAlive>) -> Self {\n            self.keep_alive = keep_alive;\n            self\n        }\n","sourceCodeStart":300,"sourceCodeEnd":336,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/fullstack/src/payloads/sse.rs#L300-L336","documentation":"An SSE event could not be serialized to JSON while building the server-sent-events stream. The event type fails Serialize (e.g. contains non-serializable fields), so the stream item cannot be produced.","triggerScenarios":"Thrown at packages/fullstack/src/payloads/sse.rs:318 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the SSE event data is serializable (valid JSON/UTF-8) before sending; check the event payload for values that fail serialization."],"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"}