{"record":{"id":"816db43401df527a","repo":"tauri-apps/tauri","slug":"no-file-name","errorCode":null,"errorMessage":"No file name","messagePattern":"No file name","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-bundler/src/bundle/macos/app.rs","lineNumber":281,"sourceCode":"\n  if let Some(associations) = settings.file_associations() {\n    if let Some(file_associations_plist) =\n      tauri_utils::config::file_associations_plist(associations)\n    {\n      if let Some(plist_dict) = file_associations_plist.as_dictionary() {\n        for (key, value) in plist_dict {\n          plist.insert(key.clone(), value.clone());\n        }\n      }\n    }\n  }\n\n  if let Some(path) = bundle_icon_file {\n    plist.insert(\n      \"CFBundleIconFile\".into(),\n      path\n        .file_name()\n        .expect(\"No file name\")\n        .to_string_lossy()\n        .into_owned()\n        .into(),\n    );\n  }\n\n  if let Some(assets_car_file) = assets_car_file {\n    if let Some(icon_name) = app_icon_name_from_assets_car(&assets_car_file) {\n      // only set CFBundleIconName for the Assets.car, CFBundleIconFile is the fallback icns file\n      plist.insert(\"CFBundleIconName\".into(), icon_name.clone().into());\n    } else {\n      log::warn!(\"Failed to get icon name from Assets.car file\");\n    }\n  }\n\n  if let Some(protocols) = settings.deep_link_protocols() {\n    plist.insert(\n      \"CFBundleURLTypes\".into(),","sourceCodeStart":263,"sourceCodeEnd":299,"githubUrl":"https://github.com/tauri-apps/tauri/blob/460ec35447493200d64290dd7f015d5a91d0fd58/crates/tauri-bundler/src/bundle/macos/app.rs#L263-L299","documentation":"In the macOS app bundler's create_info_plist, when a bundle icon file was resolved, `CFBundleIconFile` is set from the path's `file_name()`. If that path has no final component, the expect panics with \"No file name\". It indicates the computed icon path is malformed (directory-like) rather than pointing to an icon file.","triggerScenarios":"tauri build creating a macOS .app bundle where bundle_icon_file was built from an icon path lacking a filename (trailing slash, `..`, or root), then inserted into Info.plist.","commonSituations":"Icon configuration pointing at a directory instead of a file; a path manipulation bug where the icon's parent directory was passed instead of the file; unusual icon extension/config values causing downstream path joins to lose the filename.","solutions":["Point `bundle.icon` in tauri.conf.json at actual icon files (e.g. `icons/icon.icns`), not directories.","Verify the icon file exists for the macOS target (an .icns or supported PNG) so bundle_icon_file resolves to a real file.","Regenerate icons with `tauri icon` to produce a consistent set including icon.icns.","If reproducing internally, guard with `if let Some(name) = path.file_name()` and skip/fallback instead of panicking."],"exampleFix":"// before\n\"icon\": [\"icons/\"]\n// after\n\"icon\": [\"icons/icon.icns\", \"icons/128x128.png\"]","handlingStrategy":"validation","validationCode":"for icon in &config.bundle.icon {\n  let p = std::path::Path::new(icon);\n  assert!(p.is_file(), \"icon is not a file: {icon}\");\n  assert!(p.file_name().is_some(), \"icon path has no filename: {icon}\");\n}","typeGuard":"fn valid_icon_path(p: &std::path::Path) -> bool { p.is_file() && p.file_name().is_some() }","tryCatchPattern":null,"preventionTips":["Point bundle.icon at files, never directories.","Generate icons with `tauri icon` so icon.icns exists for macOS builds.","Spot-check resolved icon paths in verbose build output."],"tags":["macos","plist","icons","path","panic"],"backgroundTag":"null-argument","analyzedSha":"460ec35447493200d64290dd7f015d5a91d0fd58","analyzedAt":"2026-09-18T23:55:51.277Z","contentChangedAt":"2026-09-18T23:55:51.277Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}