{"record":{"id":"763537de4b4d75a5","repo":"zed-industries/zed","slug":"app-is-not-running-inside-a-bundle","errorCode":null,"errorMessage":"app is not running inside a bundle","messagePattern":"app is not running inside a bundle","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_macos/src/platform.rs","lineNumber":1068,"sourceCode":"    }\n\n    fn on_system_notification_response(\n        &self,\n        callback: Box<dyn FnMut(gpui::SystemNotificationResponse)>,\n    ) {\n        let mut state = self.0.lock();\n        let executor = state.foreground_executor.clone();\n        state.system_notifications.on_response(&executor, callback);\n    }\n\n    fn keyboard_layout(&self) -> Box<dyn PlatformKeyboardLayout> {\n        Box::new(MacKeyboardLayout::new())\n    }\n\n    fn keyboard_mapper(&self) -> Rc<dyn PlatformKeyboardMapper> {\n        self.0.lock().keyboard_mapper.clone()\n    }\n\n    fn app_path(&self) -> Result<PathBuf> {\n        unsafe {\n            let bundle: id = NSBundle::mainBundle();\n            anyhow::ensure!(!bundle.is_null(), \"app is not running inside a bundle\");\n            Ok(path_from_objc(msg_send![bundle, bundlePath]))\n        }\n    }\n\n    fn set_menus(&self, menus: Vec<Menu>, keymap: &Keymap) {\n        unsafe {\n            let app: id = msg_send![APP_CLASS, sharedApplication];\n            let mut state = self.0.lock();\n            let actions = &mut state.menu_actions;\n            let menu = self.create_menu_bar(&menus, NSWindow::delegate(app), actions, keymap);\n            drop(state);\n            app.setMainMenu_(menu);\n        }\n        self.0.lock().menus = Some(menus.into_iter().map(|menu| menu.owned()).collect());","sourceCodeStart":1050,"sourceCodeEnd":1086,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/gpui_macos/src/platform.rs#L1050-L1086","documentation":"Guard in app_path: the main bundle's bundleURL/path could not be resolved because the process is not running inside an .app bundle (a bare executable), so no application path exists to return. It is a sentinel for 'not a bundled macOS app', not a filesystem failure.","triggerScenarios":"Thrown at crates/gpui_macos/src/platform.rs:1036 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Only call app_path from bundled builds; gate callers that assume a bundle","Fall back to std::env::current_exe for unpackaged/dev runs","Handle the Err at the call site to disable bundle-dependent features gracefully"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}