FuelLabs/sway · error · anyhow::Error

Couldn't find member manifest for {}

Error message

Couldn't find member manifest for {}

What it means

After building, forc iterates each built package node and looks up its manifest in manifest_map keyed by the pinned package id. This failing means the dependency graph contains a node whose manifest was never collected during fetching - an internal inconsistency between plan.graph and plan.manifest_map rather than a user configuration problem.

Source

Thrown at forc-pkg/src/pkg.rs:2303

        .iter()
        .map(|(_, pkg)| pkg.bytecode.bytes.len())
        .sum::<usize>();

    println_action_green(
        "Finished",
        &format!(
            "{} [{}] in {:.2}s",
            profile_target_string(&build_profile.name, build_target),
            format_bytecode_size(total_size),
            build_start.elapsed().as_secs_f32()
        ),
    );
    for (node_ix, built_package) in built_packages {
        print_pkg_summary_header(&built_package);
        let pinned = &graph[node_ix];
        let pkg_manifest = manifest_map
            .get(&pinned.id())
            .ok_or_else(|| anyhow!("Couldn't find member manifest for {}", pinned.name))?;
        let output_dir = output_dir.clone().unwrap_or_else(|| {
            default_output_directory(pkg_manifest.dir()).join(&build_profile.name)
        });
        // Output artifacts for the built package
        if let Some(outfile) = &binary_outfile {
            built_package.write_bytecode(outfile.as_ref())?;
        }
        // Generate debug symbols if explicitly requested via -g flag or if in debug build
        if debug_outfile.is_some() || build_profile.name == BuildProfile::DEBUG {
            let debug_path = debug_outfile
                .as_ref()
                .map(|p| output_dir.join(p))
                .unwrap_or_else(|| output_dir.join("debug_symbols.obj"));
            built_package.write_debug_info(&debug_path)?;
        }

        if let Some(hex_path) = hex_outfile {
            let hexfile_path = output_dir.join(hex_path);

View on GitHub (pinned to 47e5e902fa)

Solutions

  1. Recreate the BuildPlan freshly (BuildPlan::from_lockfile / from_manifests) instead of reusing a cached or hand-built one
  2. Run forc clean (or delete the .forc directory) and rebuild so all manifests are re-fetched
  3. If you link forc-pkg programmatically, align its version with the forc binary in use
  4. If it reproduces with stock forc build, report it with the manifest and graph details
Defensive patterns

Strategy: try-catch

Try / catch

match pkg::build(&plan, ...) {
    Ok(pkgs) => pkgs,
    Err(e) if e.to_string().contains("Couldn't find member manifest") => {
        // internal inconsistency: rebuild the plan from scratch and retry once
        let plan = BuildPlan::from_manifests(&manifest_file, offline)?;
        return pkg::build(&plan, ...);
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Calling pkg::build with a BuildPlan constructed by hand, reused after mutation, or reused across forc versions - so a graph node exists without a corresponding manifest_map entry.

Common situations: Tooling that caches/reuses BuildPlans across forc upgrades; a corrupted .forc cache after an interrupted fetch; rare on stock forc invocations.

Related errors


AI-assisted analysis of FuelLabs/sway@47e5e902fa (2026-08-16). Data as JSON: /api/errors/e521a7f084c213b0. Report an issue: GitHub.