{"record":{"id":"8ad10f2df8ae0667","repo":"slint-ui/slint","slug":"connection-is-no-longer-available","errorCode":null,"errorMessage":"Connection is no longer available","messagePattern":"Connection is no longer available","errorType":"exception","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"internal/live-preview/remote/compilation.rs","lineNumber":21,"sourceCode":"\nuse std::rc::Weak;\n\nuse i_slint_core::InternalToken;\nuse lsp_types::Url;\n\nuse super::connection::Connection;\n\npub fn init_compiler(connection: Weak<Connection>) -> slint_interpreter::Compiler {\n    let mut compiler = slint_interpreter::Compiler::new();\n\n    let file_loader_connection = connection.clone();\n    compiler.set_file_loader(move |path: &std::path::Path| {\n        let url = Url::from_file_path(path);\n        let path_display = path.display().to_string();\n        let connection = file_loader_connection.clone();\n        Box::pin(async move {\n            let Some(connection) = connection.upgrade() else {\n                return Some(Err(std::io::Error::new(\n                    std::io::ErrorKind::BrokenPipe,\n                    \"Connection is no longer available\",\n                )));\n            };\n            let Ok(url) = url else {\n                return Some(Err(std::io::Error::new(\n                    std::io::ErrorKind::InvalidInput,\n                    format!(\"Not an absolute file path: {path_display}\"),\n                )));\n            };\n            Some(\n                connection.request_file(url).await.map(|file_content| {\n                    String::from_utf8_lossy(&file_content.contents).to_string()\n                }),\n            )\n        })\n    });\n","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/slint-ui/slint/blob/3fd8f2ec03c2aa8a95d5f4b9daa299c7b8bf4016/internal/live-preview/remote/compilation.rs#L3-L39","documentation":"Error \"Connection is no longer available\" thrown in slint-ui/slint.","triggerScenarios":"Thrown at internal/live-preview/remote/compilation.rs:21 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reconnect the live-preview remote connection and retry the operation.","Check the network/WebSocket between the viewer and the remote side."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3fd8f2ec03c2aa8a95d5f4b9daa299c7b8bf4016","analyzedAt":"2026-08-19T23:23:16.610Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}