{"record":{"id":"6814c7007ad693c7","repo":"zed-industries/zed","slug":"idle-sleep-prevention-for-reason-is-not-supported-in-the","errorCode":null,"errorMessage":"Idle sleep prevention for {reason:?} is not supported in the browser","messagePattern":"Idle sleep prevention for (.+?) is not supported in the browser","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_web/src/platform.rs","lineNumber":527,"sourceCode":"\n    fn on_will_open_app_menu(&self, callback: Box<dyn FnMut()>) {\n        self.callbacks.borrow_mut().will_open_app_menu = Some(callback);\n    }\n\n    fn on_validate_app_menu_command(&self, callback: Box<dyn FnMut(&dyn Action) -> bool>) {\n        self.callbacks.borrow_mut().validate_app_menu_command = Some(callback);\n    }\n\n    fn thermal_state(&self) -> ThermalState {\n        ThermalState::Nominal\n    }\n\n    fn on_thermal_state_change(&self, callback: Box<dyn FnMut()>) {\n        self.callbacks.borrow_mut().thermal_state_change = Some(callback);\n    }\n\n    fn prevent_idle_sleep(&self, reason: &str) -> Task<Result<ActivityGuard>> {\n        Task::ready(Err(anyhow::anyhow!(\n            \"Idle sleep prevention for {reason:?} is not supported in the browser\"\n        )))\n    }\n\n    fn compositor_name(&self) -> &'static str {\n        \"Web\"\n    }\n\n    fn app_path(&self) -> Result<PathBuf> {\n        Err(anyhow::anyhow!(\"app_path is not available on the web\"))\n    }\n\n    fn path_for_auxiliary_executable(&self, _name: &str) -> Result<PathBuf> {\n        Err(anyhow::anyhow!(\n            \"path_for_auxiliary_executable is not available on the web\"\n        ))\n    }\n","sourceCodeStart":509,"sourceCodeEnd":545,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/gpui_web/src/platform.rs#L509-L545","documentation":"An explicit capability guard in the browser implementation of prevent_idle_sleep: desktop platforms use the reason string to acquire a power-save blocker (e.g. during long operations), but no equivalent Wake Lock API call is wired into this web platform stub, so the request is rejected with this message rather than silently pretending to work. It fires whenever application code asks the web platform to keep the display/system awake.","triggerScenarios":"Thrown at crates/gpui_web/src/platform.rs:527 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ignore this error on the web: idle-sleep prevention is intentionally unsupported there","Gate prevent_idle_sleep usage on the platform (cfg or a runtime capability check) before calling it","Contribute a navigator.wakeLock.request('screen') implementation behind a browser feature check to actually support it"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-09-12T19:35:53.743Z","contentChangedAt":"2026-09-12T19:35:53.743Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}