{"record":{"id":"394af43cac371373","repo":"astrid-runtime/astrid","slug":"could-not-locate-compiled-wasm-binary-at-target","errorCode":null,"errorMessage":"Could not locate compiled WASM binary at `target/{target}/{PROFILE}/{wasm_name}.wasm` under configured target directory {}","messagePattern":"Could not locate compiled WASM binary at `target/(.+?)/(.+?)/(.+?)\\.wasm` under configured target directory (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-build/src/rust.rs","lineNumber":614,"sourceCode":"/// profile. There is deliberately no recursive search or local-target\n/// fallback: probing other roots could select stale artifacts when a\n/// host-wide target root is configured.\nfn locate_wasm_binary(\n    meta: &cargo_metadata::Metadata,\n    target: &str,\n    wasm_name: &str,\n) -> Result<PathBuf> {\n    const PROFILE: &str = \"release\";\n    let target_root = meta.target_directory.as_std_path();\n    validate_wasm_output_name(wasm_name)?;\n\n    let candidate = target_root\n        .join(target)\n        .join(PROFILE)\n        .join(format!(\"{wasm_name}.wasm\"));\n    let artifact_metadata = match fs::symlink_metadata(&candidate) {\n        Ok(metadata) => metadata,\n        Err(error) if error.kind() == std::io::ErrorKind::NotFound => bail!(\n            \"Could not locate compiled WASM binary at `target/{target}/{PROFILE}/{wasm_name}.wasm` under configured target directory {}\",\n            target_root.display()\n        ),\n        Err(error) => {\n            return Err(error).with_context(|| {\n                format!(\n                    \"Failed to inspect compiled WASM binary {}\",\n                    candidate.display()\n                )\n            });\n        },\n    };\n\n    if artifact_metadata.file_type().is_symlink() {\n        bail!(\"Compiled WASM binary is a symlink: {}\", candidate.display());\n    }\n    if !artifact_metadata.is_file() {\n        bail!(","sourceCodeStart":596,"sourceCodeEnd":632,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-build/src/rust.rs#L596-L632","documentation":"Fired by locate_wasm_binary when `target/<target>/release/<wasm_name>.wasm` does not exist under the configured target directory. There is deliberately no recursive search: probing other roots could pick stale artifacts.","triggerScenarios":"Thrown at crates/astrid-build/src/rust.rs:614 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rebuild with the same target triple and target directory the build configures","Check that CARGO_TARGET_DIR/configured target dir matches where the build ran","Verify the wasm target component is installed and the build succeeded"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}