{"record":{"id":"766fb8aec7f6584a","repo":"zed-industries/zed","slug":"cannot-register-url-scheme-until-app-is-installed","errorCode":null,"errorMessage":"Cannot register URL scheme until app is installed","messagePattern":"Cannot register URL scheme until app is installed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_macos/src/platform.rs","lineNumber":780,"sourceCode":"    fn register_url_scheme(&self, scheme: &str) -> Task<anyhow::Result<()>> {\n        use objc2_foundation::{NSBundle, NSError, NSString};\n\n        // API only available post Monterey\n        // https://developer.apple.com/documentation/appkit/nsworkspace/3753004-setdefaultapplicationaturl\n        let (done_tx, done_rx) = oneshot::channel();\n        if Self::os_version() < Version::new(12, 0, 0) {\n            return Task::ready(Err(anyhow!(\n                \"macOS 12.0 or later is required to register URL schemes\"\n            )));\n        }\n\n        let Some(bundle_id) = NSBundle::mainBundle().bundleIdentifier() else {\n            return Task::ready(Err(anyhow!(\"Can only register URL scheme in bundled apps\")));\n        };\n\n        let workspace = NSWorkspace::sharedWorkspace();\n        let Some(app) = workspace.URLForApplicationWithBundleIdentifier(&bundle_id) else {\n            return Task::ready(Err(anyhow!(\n                \"Cannot register URL scheme until app is installed\"\n            )));\n        };\n\n        let scheme = NSString::from_str(scheme);\n\n        let done_tx = Cell::new(Some(done_tx));\n        let handler = RcBlock::new(move |error: *mut NSError| {\n            let result = if let Some(error) = unsafe { error.as_ref() } {\n                Err(anyhow!(\n                    \"Failed to register: {}\",\n                    error.localizedDescription()\n                ))\n            } else {\n                Ok(())\n            };\n\n            if let Some(done_tx) = done_tx.take() {","sourceCodeStart":762,"sourceCodeEnd":798,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/gpui_macos/src/platform.rs#L762-L798","documentation":"Guard in register_url_scheme: NSWorkspace.URLForApplicationWithBundleIdentifier returned nil — the bundle identifier exists but the application is not actually installed at a location Launch Services knows (common right after building but before copying to /Applications).","triggerScenarios":"Thrown at crates/gpui_macos/src/platform.rs:748 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Install/copy the app to /Applications (or register its location with Launch Services) before registering schemes","Re-register with lsregister if the app was moved and Launch Services state is stale","Retry registration after the app is confirmed present at its registered path"],"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-14T05:17:10.506Z"}