{"record":{"id":"7042251aa525e5e2","repo":"tauri-apps/tauri","slug":"couldn-t-get-framework-filename-app","errorCode":null,"errorMessage":"Couldn't get framework filename","messagePattern":"Couldn't get framework filename","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-bundler/src/bundle/macos/app.rs","lineNumber":401,"sourceCode":"// Copies the macOS application bundle frameworks to the .app\nfn copy_frameworks_to_bundle(\n  bundle_directory: &Path,\n  settings: &Settings,\n) -> crate::Result<Vec<SignTarget>> {\n  let mut paths = Vec::new();\n\n  let frameworks = settings.macos().frameworks.clone().unwrap_or_default();\n  if frameworks.is_empty() {\n    return Ok(paths);\n  }\n  let dest_dir = bundle_directory.join(\"Frameworks\");\n  fs::create_dir_all(&dest_dir).fs_context(\"failed to create Frameworks directory\", &dest_dir)?;\n  for framework in frameworks.iter() {\n    if framework.ends_with(\".framework\") {\n      let src_path = PathBuf::from(framework);\n      let src_name = src_path\n        .file_name()\n        .expect(\"Couldn't get framework filename\");\n      let dest_path = dest_dir.join(src_name);\n      fs_utils::copy_dir(&src_path, &dest_path)?;\n      add_framework_sign_path(&src_path, &dest_path, &mut paths);\n      continue;\n    } else if framework.ends_with(\".dylib\") {\n      let src_path = PathBuf::from(framework);\n      if !src_path.exists() {\n        return Err(GenericError(format!(\"Library not found: {framework}\")));\n      }\n      let src_name = src_path.file_name().expect(\"Couldn't get library filename\");\n      let dest_path = dest_dir.join(src_name);\n      fs_utils::copy_file(&src_path, &dest_path)?;\n      paths.push(SignTarget {\n        path: dest_path,\n        is_an_executable: false,\n      });\n      continue;\n    } else if framework.contains('/') {","sourceCodeStart":383,"sourceCodeEnd":419,"githubUrl":"https://github.com/tauri-apps/tauri/blob/460ec35447493200d64290dd7f015d5a91d0fd58/crates/tauri-bundler/src/bundle/macos/app.rs#L383-L419","documentation":"In the macOS bundler's copy_frameworks_to_bundle, `.framework` entries are copied by joining the source's `file_name()` to the bundle's Frameworks directory. When the framework path lacks a final component, file_name() returns None and the expect panics. The bundler assumes every configured framework path ends in `Name.framework`.","triggerScenarios":"tauri build producing a macOS .app with `bundle.macOS.frameworks` (or equivalent settings) containing a `.framework` path with a trailing slash, `..`, or otherwise no filename component.","commonSituations":"Config entries like `\"Frameworks/MyKit.framework/\"`; CI variables expanding to leave a dangling separator; switching from a file to a directory path without updating the config.","solutions":["Remove trailing separators and `..` so each entry ends in `Name.framework`.","Confirm each framework path exists at build time and points at the .framework bundle directory.","Use absolute or workspace-relative clean paths in the frameworks list.","If paths come from a script, validate `path.file_name().is_some()` before invoking the bundler."],"exampleFix":"// before\n\"frameworks\": [\"../Frameworks/Spark.framework/\"]\n// after\n\"frameworks\": [\"../Frameworks/Spark.framework\"]","handlingStrategy":"validation","validationCode":"for fw in frameworks {\n  let p = std::path::PathBuf::from(fw);\n  assert!(fw.ends_with(\".framework\") && p.file_name().is_some(), \"bad framework path: {fw}\");\n  assert!(p.exists(), \"framework not found: {fw}\");\n}","typeGuard":"fn valid_framework(p: &std::path::Path) -> bool { p.file_name().is_some() && p.is_dir() }","tryCatchPattern":null,"preventionTips":["End entries with `Name.framework`, no trailing slash.","Resolve and print framework paths in CI before packaging.","Keep the frameworks list static and reviewed rather than dynamically generated."],"tags":["macos","framework","path","panic","bundling"],"backgroundTag":"invalid-argument-format","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"}