{"record":{"id":"5e7a0e36e46dfb70","repo":"FuelLabs/sway","slug":"cannot-find-manifest-for","errorCode":null,"errorMessage":"Cannot find manifest for {}","messagePattern":"Cannot find manifest for (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"forc-pkg/src/pkg.rs","lineNumber":1272,"sourceCode":"    }\n    Ok(manifest_map)\n}\n\n/// Given a graph of pinned packages and the project manifest, produce a map containing the\n/// manifest of for every node in the graph.\n///\n/// Assumes the given `graph` only contains valid dependencies (see `validate_graph`).\n///\n/// `pkg_graph_to_manifest_map` starts from each node (which corresponds to the given proj_manifest)\n/// and visits children to collect their manifest files.\nfn pkg_graph_to_manifest_map(\n    manifests: &MemberManifestFiles,\n    pkg_name: &str,\n    graph: &Graph,\n) -> Result<ManifestMap> {\n    let proj_manifest = manifests\n        .get(pkg_name)\n        .ok_or_else(|| anyhow!(\"Cannot find manifest for {}\", pkg_name))?;\n    let mut manifest_map = ManifestMap::new();\n\n    // Traverse the graph from the project node.\n    let Ok(proj_node) = find_proj_node(graph, &proj_manifest.project.name) else {\n        return Ok(manifest_map);\n    };\n    let proj_id = graph[proj_node].id();\n    manifest_map.insert(proj_id, proj_manifest.clone());\n\n    // Resolve all parents before their dependencies as we require the parent path to construct the\n    // dependency path. Skip the already added project node at the beginning of traversal.\n    let mut bfs = Bfs::new(graph, proj_node);\n    bfs.next(graph);\n    while let Some(dep_node) = bfs.next(graph) {\n        // Retrieve the parent node whose manifest is already stored.\n        let (parent_manifest, dep_name) = graph\n            .edges_directed(dep_node, Direction::Incoming)\n            .find_map(|edge| {","sourceCodeStart":1254,"sourceCodeEnd":1290,"githubUrl":"https://github.com/FuelLabs/sway/blob/47e5e902faa42baf652dd6a0c88cd23390c1a614/forc-pkg/src/pkg.rs#L1254-L1290","documentation":"pkg_graph_to_manifest_map looks up pkg_name in the MemberManifestFiles map (keyed by member name) and fails. Since the caller graph_to_manifest_map derives pkg_name from the same map's values, hitting this means the map's keys are inconsistent with member project.name values - in practice duplicate member names collapsing map entries, or an internal inconsistency after manifest/lock drift.","triggerScenarios":"Two members with the same [project] name so the name-keyed map loses entries; stale Forc.lock describing a member that no longer resolves; manifest map built from a partially updated workspace.","commonSituations":"Duplicate member names after copy-paste; renamed members with stale lock; unusual nested workspace structures.","solutions":["Ensure every member's [project] name is unique within the workspace.","Regenerate Forc.lock (delete or 'forc update') and rebuild.","If it persists on a clean lock and unique names, report to FuelLabs/sway as a forc-pkg bug."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"for m in member_manifests.values() {\n    let name = m.project.name.clone();\n    if !member_manifests.contains_key(&name) {\n        return Err(format!(\"member map key mismatch for '{name}'; duplicate member names?\"));\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Enforce unique member names across the workspace (same guard as the duplicate-name check).","Regenerate Forc.lock after adding, removing or renaming members."],"tags":["graph","manifest","workspace","duplicate"],"backgroundTag":null,"analyzedSha":"47e5e902faa42baf652dd6a0c88cd23390c1a614","analyzedAt":"2026-08-16T07:57:45.555Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}