{"record":{"id":"dd65c1e5a690fb09","repo":"tauri-apps/tauri","slug":"could-not-get-icon-filename","errorCode":null,"errorMessage":"Could not get icon filename","messagePattern":"Could not get icon filename","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-bundler/src/bundle/macos/icon.rs","lineNumber":32,"sourceCode":"  process::Command,\n};\n\nuse image::GenericImageView;\n\n// Given a list of icon files, try to produce an ICNS file in the out_dir\n// and return the path to it.  Returns `Ok(None)` if no usable icons\n// were provided.\npub fn create_icns_file(out_dir: &Path, settings: &Settings) -> crate::Result<Option<PathBuf>> {\n  if settings.icon_files().count() == 0 {\n    return Ok(None);\n  }\n\n  // If one of the icon files is already an ICNS file, just use that.\n  for icon_path in settings.icon_files() {\n    let icon_path = icon_path?;\n    if icon_path.extension() == Some(OsStr::new(\"icns\")) {\n      let mut dest_path = out_dir.to_path_buf();\n      dest_path.push(icon_path.file_name().expect(\"Could not get icon filename\"));\n      fs_utils::copy_file(&icon_path, &dest_path)?;\n      return Ok(Some(dest_path));\n    }\n  }\n\n  // Otherwise, read available images and pack them into a new ICNS file.\n  let mut family = icns::IconFamily::new();\n\n  fn add_icon_to_family(\n    icon: image::DynamicImage,\n    density: u32,\n    family: &mut icns::IconFamily,\n  ) -> io::Result<()> {\n    // Try to add this image to the icon family.  Ignore images whose sizes\n    // don't map to any ICNS icon type; print warnings and skip images that\n    // fail to encode.\n    match icns::IconType::from_pixel_size_and_density(icon.width(), icon.height(), density) {\n      Some(icon_type) => {","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/tauri-apps/tauri/blob/460ec35447493200d64290dd7f015d5a91d0fd58/crates/tauri-bundler/src/bundle/macos/icon.rs#L14-L50","documentation":"Panics in create_icns_file when it cannot derive a filename from an icon path while collecting icons for the macOS .icns bundle. Called from bundle_project on macOS; a missing or non-UTF-8 file_name on an icon path supplied via settings makes the filename extraction impossible, aborting the bundle.","triggerScenarios":"Thrown at crates/tauri-bundler/src/bundle/macos/icon.rs:32 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure every configured icon path has a valid, non-empty filename with a normal extension.","Check bundle > icon entries in tauri.conf.json for malformed paths or trailing slashes.","Supply at least one valid .icns or .png icon before building for macOS."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}