FuelLabs/sway · error · anyhow::Error

failed to find package `{}` in {}

Error message

failed to find package `{}` in {}

What it means

Error "failed to find package `{}` in {}" thrown in FuelLabs/sway.

Source

Thrown at forc-pkg/src/source/reg/mod.rs:412

                let fetch_id = ctx.fetch_id();
                let ipfs_node = ctx.ipfs_node().clone();

                block_on_any_runtime(async move {
                    // If the user is trying to use public IPFS node with
                    // registry sources. Use fuel operated ipfs node
                    // instead.
                    let node = match ipfs_node {
                        node if node == IPFSNode::public() => IPFSNode::fuel(),
                        node => node,
                    };
                    fetch(fetch_id, &pinned, &node).await
                })?;
            }
        }
        let path = {
            let _guard = lock.read()?;
            manifest::find_within(path, ctx.name())
                .ok_or_else(|| anyhow!("failed to find package `{}` in {}", ctx.name(), self))?
        };
        PackageManifestFile::from_file(path)
    }
}

impl source::DepPath for Pinned {
    fn dep_path(&self, _name: &str) -> anyhow::Result<source::DependencyPath> {
        bail!("dep_path: registry dependencies are not yet supported");
    }
}

impl From<Pinned> for source::Pinned {
    fn from(p: Pinned) -> Self {
        Self::Registry(p)
    }
}

/// Resolve a CID from index file and pinned package. Basically goes through

View on GitHub (pinned to 47e5e902fa)

When it happens

Trigger: Thrown at forc-pkg/src/source/reg/mod.rs:412 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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