{"record":{"id":"cedd9625e71b390b","repo":"tauri-apps/tauri","slug":"not-found-required-for-generating-a-windows","errorCode":null,"errorMessage":"`{}` not found; required for generating a Windows Resource file during tauri-build","messagePattern":"`(.+?)` not found; required for generating a Windows Resource file during tauri-build","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-build/src/lib.rs","lineNumber":720,"sourceCode":"    });\n\n    res.set(\"CompanyName\", &company_name);\n\n    let file_description = config\n      .product_name\n      .or_else(|| manifest.package.as_ref().map(|p| p.name.clone()))\n      .or_else(|| std::env::var(\"CARGO_PKG_NAME\").ok());\n\n    res.set(\"FileDescription\", &file_description.unwrap());\n\n    if let Some(copyright) = &config.bundle.copyright {\n      res.set(\"LegalCopyright\", copyright);\n    }\n\n    if window_icon_path.exists() {\n      res.set_icon_with_id(&window_icon_path.display().to_string(), \"32512\");\n    } else {\n      return Err(anyhow!(format!(\n        \"`{}` not found; required for generating a Windows Resource file during tauri-build\",\n        window_icon_path.display()\n      )));\n    }\n\n    res.compile().with_context(|| {\n      format!(\n        \"failed to compile `{}` into a Windows Resource file during tauri-build\",\n        window_icon_path.display()\n      )\n    })?;\n\n    let target_env = env::var(\"CARGO_CFG_TARGET_ENV\").unwrap();\n    match target_env.as_str() {\n      \"gnu\" => {\n        let target_arch = match env::var(\"CARGO_CFG_TARGET_ARCH\").unwrap().as_str() {\n          \"x86_64\" => Some(\"x64\"),\n          \"x86\" => Some(\"x86\"),","sourceCodeStart":702,"sourceCodeEnd":738,"githubUrl":"https://github.com/tauri-apps/tauri/blob/460ec35447493200d64290dd7f015d5a91d0fd58/crates/tauri-build/src/lib.rs#L702-L738","documentation":"While generating a Windows resource file, tauri-build embeds the window icon into the .res via set_icon_with_id; if the configured window icon file is missing the build fails with this error naming the expected path.","triggerScenarios":"Building for Windows (try_build -> build) when `bundle.icon` / the window icon path (typically icons/icon.ico) does not exist on disk.","commonSituations":"Fresh clone missing icons directory, icon path customized in tauri.conf.json but file renamed, or `create-tauri-app` scaffolding step skipped.","solutions":["Create the icon at the expected path (default icons/icon.ico) e.g. via `cargo tauri icon`","Fix the icon path in tauri.conf.json `bundle.icon` to point at the existing .ico","Ensure icons are committed to version control so CI has them"],"exampleFix":"// before (tauri.conf.json)\n\"icon\": [\"icons/missing.ico\"]\n// after\n\"icon\": [\"icons/icon.ico\"]  // run `cargo tauri icon app-icon.png` to generate","handlingStrategy":"validation","validationCode":"const icons = cfg.bundle?.icon ?? [];\nif (process.platform === 'win32' && !icons.some(i => i.endsWith('.ico') && fs.existsSync(resolve('src-tauri', i)))) {\n  throw new Error('No existing .ico window icon configured; run `cargo tauri icon`');\n}","typeGuard":"const hasWindowIcon = (cfg: Config) => (cfg.bundle?.icon ?? []).some(i => i.endsWith('.ico') && existsSync(join('src-tauri', i)));","tryCatchPattern":"try {\n  await buildWindows();\n} catch (e) {\n  if (String(e).includes('not found; required for generating a Windows Resource file')) {\n    throw new Error('Generate icons: cargo tauri icon app-icon.png');\n  }\n  throw e;\n}","preventionTips":["Run `cargo tauri icon` after any app-icon change and commit icons/","Never gitignore the icons directory","Keep the .ico path in bundle.icon matching the actual file name"],"tags":["windows","icon","resource-file","tauri-build"],"backgroundTag":"file-not-found","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"}