{"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":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tauri-build/src/lib.rs","lineNumber":717,"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":699,"sourceCodeEnd":735,"githubUrl":"https://github.com/tauri-apps/tauri/blob/2f1cd75b0f3fb72e6870d719bbfeadedcf8ca884/crates/tauri-build/src/lib.rs#L699-L735","documentation":"On Windows targets tauri-build embeds a Windows Resource (version info plus icon) using the winres machinery, and it requires the window icon file - derived from the bundle.icon configuration, by default src-tauri/icons/icon.ico - to exist. If window_icon_path is absent, the resource generation step aborts before res.compile() with this error naming the missing path.","triggerScenarios":"Building for a Windows target (tauri build, or cargo build --target *-pc-windows-*) when the configured/default .ico file does not exist - fresh project without generated icons, custom bundle.icon path typo, or icons directory deleted/not committed.","commonSituations":"New repos missing the icons folder; CI checkouts excluding generated assets; moving icons without updating tauri.conf.json; overriding bundle.icon to a source PNG instead of a compiled .ico.","solutions":["Generate a full icon set from a source image: npm run tauri icon path/to/app-icon.png (creates src-tauri/icons including icon.ico)","Or place a valid .ico file at the exact path printed in the error (default src-tauri/icons/icon.ico)","Verify bundle.icon in tauri.conf.json points at an existing .ico file and commit icons to the repository"],"exampleFix":"# before: src-tauri/icons/icon.ico missing -> build fails\n\n# after\nnpm run tauri icon ./app-icon.png  # regenerates src-tauri/icons/icon.ico\ngit add src-tauri/icons","handlingStrategy":"validation","validationCode":"# prebuild check (Windows targets): icon.ico must exist\n[ -f src-tauri/icons/icon.ico ] || npx tauri icon assets/app-icon.png","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `tauri icon` once during project setup and commit src-tauri/icons to git","If bundle.icon is customized, point it at a committed .ico file","Cross-compile CI jobs should check the icon path exists before cargo build"],"tags":["windows","icon","resource","tauri-build","config"],"backgroundTag":null,"analyzedSha":"2f1cd75b0f3fb72e6870d719bbfeadedcf8ca884","analyzedAt":"2026-08-16T04:18:42.486Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}