{"record":{"id":"f2307538987a5574","repo":"FuelLabs/sway","slug":"cannot-found-project-node-in-the-graph","errorCode":null,"errorMessage":"Cannot found project node in the graph","messagePattern":"Cannot found project node in the graph","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"forc-pkg/src/pkg.rs","lineNumber":2263,"sourceCode":"\n    let build_plan = BuildPlan::from_pkg_opts(&build_options.pkg)?;\n    let graph = build_plan.graph();\n    let manifest_map = build_plan.manifest_map();\n\n    // Check if manifest used to create the build plan is one of the member manifests or a\n    // workspace manifest.\n    let curr_manifest = manifest_map\n        .values()\n        .find(|&pkg_manifest| pkg_manifest.dir() == path);\n    let build_profiles: HashMap<String, BuildProfile> = build_plan.build_profiles().collect();\n    // Get the selected build profile using build options\n    let build_profile = build_profile_from_opts(&build_profiles, build_options)?;\n    // If this is a workspace we want to have all members in the output.\n    let outputs = match curr_manifest {\n        Some(pkg_manifest) => std::iter::once(\n            build_plan\n                .find_member_index(&pkg_manifest.project.name)\n                .ok_or_else(|| anyhow!(\"Cannot found project node in the graph\"))?,\n        )\n        .collect(),\n        None => build_plan.member_nodes().collect(),\n    };\n\n    let outputs = member_filter.filter_outputs(&build_plan, outputs);\n\n    // Build it!\n    let mut built_workspace = Vec::new();\n    let build_start = std::time::Instant::now();\n    let built_packages = build(\n        &build_plan,\n        *build_target,\n        &build_profile,\n        &outputs,\n        experimental,\n        no_experimental,\n        callback_handler,","sourceCodeStart":2245,"sourceCodeEnd":2281,"githubUrl":"https://github.com/FuelLabs/sway/blob/47e5e902faa42baf652dd6a0c88cd23390c1a614/forc-pkg/src/pkg.rs#L2245-L2281","documentation":"When building a single selected package (a manifest at a given path rather than the whole workspace), forc matches that manifest's directory and then looks up its project name among the build plan's member nodes via find_member_index. If the name is not found, the selected manifest is not a member of the resolved plan and this error is returned.","triggerScenarios":"Calling the build API (or forc build --path ...) with a package whose [project].name is not among the resolved workspace members - because of a rename, an exclude pattern, or pointing at a package outside the workspace.","commonSituations":"Renaming a member in its Forc.toml while scripts/CI still reference the old path; [workspace] include/exclude globs that silently drop the package; nested workspaces resolving to the wrong root.","solutions":["Open the Forc.toml at the path you passed and confirm its [project] name; confirm that name is resolvable as a member of the workspace (listed in members or auto-included)","Build from the workspace root without --path to see which members forc actually resolves","Fix [workspace] include/exclude globs so the package is included","Check for duplicate member names after a rename that shadow each other"],"exampleFix":"# before: package renamed in its own Forc.toml\n[project]\nname = \"new_name\"\n# workspace Forc.toml still uses the old dir/name\n\n# after: keep workspace members and project names in sync\n[workspace]\nmembers = [\"packages/new_name\"]","handlingStrategy":"validation","validationCode":"use forc_pkg::{BuildPlan, pkg::BuildOptions};\n\nfn selected_pkg_is_member(manifest_name: &str, plan: &BuildPlan) -> bool {\n    plan.member_nodes()\n        .any(|ix| plan.graph()[ix].name == manifest_name)\n}\n\n// before calling build_with_options with a --path manifest:\n// assert selected_pkg_is_member(&manifest.project.name, &plan);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep [project].name stable, or update workspace members and references in the same change","When scripting builds, resolve the member list from the plan before selecting a package","Build from the workspace root when unsure which members resolve"],"tags":["rust","forc","workspace","build-plan"],"backgroundTag":null,"analyzedSha":"47e5e902faa42baf652dd6a0c88cd23390c1a614","analyzedAt":"2026-08-16T07:57:45.555Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}