{"record":{"id":"9e9b67185593f3ab","repo":"slint-ui/slint","slug":"cannot-show-placeholder-err","errorCode":null,"errorMessage":"Cannot show placeholder: {err}","messagePattern":"Cannot show placeholder: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"tools/viewer/remote.rs","lineNumber":458,"sourceCode":"        window.set_third_party_licenses(self.licenses.clone());\n        window.set_pairing_disabled(self.pairing_disabled);\n    }\n}\n\n/// Reinstall a fresh placeholder onto the existing window and drop the user instance.\nfn swap_to_placeholder(\n    placeholder: &mut RemoteViewerWindow,\n    user_instance: &mut Option<slint_interpreter::ComponentInstance>,\n    chrome: &Chrome,\n    message: &str,\n    state: RemoteViewerState,\n) -> anyhow::Result<()> {\n    let fresh = RemoteViewerWindow::new_with_existing_window(placeholder.window())\n        .map_err(|err| anyhow::anyhow!(\"Cannot create placeholder: {err}\"))?;\n    chrome.apply(&fresh);\n    fresh.set_message(SharedString::from(message));\n    fresh.set_state(state);\n    fresh.show().map_err(|err| anyhow::anyhow!(\"Cannot show placeholder: {err}\"))?;\n    *placeholder = fresh;\n    *user_instance = None;\n    Ok(())\n}\n\n/// Platform-specific override for the friendly device name. Returns `None` on platforms\n/// where the default chain in `Connection` (pretty hostname → hostname, then Bonjour on\n/// Apple) is already best.\nfn device_name_override() -> Option<String> {\n    #[cfg(target_os = \"android\")]\n    {\n        ANDROID_DEVICE_NAME.lock().unwrap_or_else(|e| e.into_inner()).clone()\n    }\n    #[cfg(not(target_os = \"android\"))]\n    {\n        None\n    }\n}","sourceCodeStart":440,"sourceCodeEnd":476,"githubUrl":"https://github.com/slint-ui/slint/blob/bb937076de3f7919766c1f25e2e969367cf77e9a/tools/viewer/remote.rs#L440-L476","documentation":"fresh.show() failed in swap_to_placeholder after the placeholder window was successfully created and populated with the chrome (address, name, licenses) and status message. The runtime could not present the placeholder screen on the existing window, so the fallback UI cannot be displayed and the error propagates as unrecoverable.","triggerScenarios":"swap_to_placeholder (called from run_async or build_and_show) succeeds in creating `fresh` but fresh.show() returns Err — the platform backend refuses to show the window (event loop dead, window in teardown, renderer failure).","commonSituations":"Window/backend teardown races the placeholder swap when the editor disconnects; embedded platform cannot show a window at this point (e.g. display not ready); slint platform initialization failure on the device.","solutions":["Retry by restarting the remote viewer flow so the event loop and window are re-created.","Ensure the slint platform/event loop is initialized and running before swap_to_placeholder is called.","Guard against swapping during window teardown: check that the connection/window is still live first.","Inspect the inner show() error to identify the platform-backend cause and fix the window setup."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match fresh.show() {\n    Ok(()) => { *placeholder = fresh; *user_instance = None; },\n    Err(err) => {\n        tracing::error!(\"Cannot show placeholder: {err}\");\n        // surface a connection error to the caller; do not continue with a half-swapped state\n        return Err(anyhow::anyhow!(err.to_string()));\n    }\n}","preventionTips":["Ensure the slint platform event loop is initialized and running before any show() call.","Do not race window teardown against placeholder swaps on editor disconnect.","Validate the platform backend supports showing windows at this lifecycle point (e.g. display ready on embedded).","Handle show() failure by terminating the session cleanly rather than leaving placeholder/user_instance inconsistent."],"tags":["slint","window","placeholder","remote-viewer"],"backgroundTag":"component-instantiation-failed","analyzedSha":"bb937076de3f7919766c1f25e2e969367cf77e9a","analyzedAt":"2026-09-16T01:37:20.251Z","contentChangedAt":"2026-09-16T01:37:20.251Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}