FuelLabs/sway · error

no entry in parent manifest

Error message

no entry in parent manifest

What it means

validate_dep found a graph edge named dep_name pointing at a dependency node, but node_manifest.dep(dep_name) returned None - the parent package's Forc.toml has no [dependencies]/[contract-dependencies] entry under that name. The edge set implied by the lock disagrees with the parent manifest.

Source

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

    let node_manifest = manifests
        .get(dep_name)
        .ok_or_else(|| anyhow!("Couldn't find manifest file for {}", dep_name))?;
    // Check the validity of the dependency path, including its path root.
    let dep_path = dep_path(graph, node_manifest, dep_node, manifests).map_err(|e| {
        anyhow!(
            "failed to construct path for dependency {:?}: {}",
            dep_name,
            e
        )
    })?;

    // Ensure the manifest is accessible.
    let dep_manifest = PackageManifestFile::from_dir(&dep_path)?;

    // Check that the dependency's source matches the entry in the parent manifest.
    let dep_entry = node_manifest
        .dep(dep_name)
        .ok_or_else(|| anyhow!("no entry in parent manifest"))?;
    let dep_source =
        Source::from_manifest_dep_patched(node_manifest, dep_name, dep_entry, manifests)?;
    let dep_pkg = graph[dep_node].unpinned(&dep_path);
    if dep_pkg.source != dep_source {
        bail!("dependency node's source does not match manifest entry");
    }

    validate_dep_manifest(&graph[dep_node], &dep_manifest, dep_edge)?;

    Ok(dep_manifest)
}
/// Part of dependency validation, any checks related to the dependency's manifest content.
fn validate_dep_manifest(
    dep: &Pinned,
    dep_manifest: &PackageManifestFile,
    dep_edge: &Edge,
) -> Result<()> {
    let dep_program_type = dep_manifest.program_type()?;

View on GitHub (pinned to 47e5e902fa)

Solutions

  1. Regenerate Forc.lock (delete it, or 'forc update') so edges are derived from current manifests.
  2. Confirm the dependency entry exists under the correct section of the parent's Forc.toml if it is expected.

Example fix

# before
forc build   # no entry in parent manifest

# after
rm Forc.lock && forc build
Defensive patterns

Strategy: validation

Validate before calling

for e in graph.edge_references() {
    let parent = &graph[e.source()];
    let parent_manifest = member_manifests.get(parent.name.as_str());
    if let Some(pm) = parent_manifest {
        if pm.dep(&e.weight().name).is_none() {
            // graph edge not declared in the parent manifest: regenerate Forc.lock
        }
    }
}

Prevention

When it happens

Trigger: A dependency was removed from the parent Forc.toml while Forc.lock still holds the edge (validation pruning did not cover it - e.g. after patches renamed the relationship); a hand-edited lock with extra edges; branch switches desynchronizing manifest and lock.

Common situations: Stale or manually edited Forc.lock; removing a dep key from Forc.toml without rebuilding; merging manifests but not locks.

Related errors


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