{"record":{"id":"a2fdf4f20cd39634","repo":"bevyengine/bevy","slug":"bevy-ecs-should-be-found-in-manifest","errorCode":null,"errorMessage":"bevy_ecs should be found in manifest","messagePattern":"bevy_ecs should be found in manifest","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/bevy_extract/macros/src/extract_component.rs","lineNumber":12,"sourceCode":"use bevy_macro_utils::fq_std::{FQClone, FQOption};\nuse proc_macro::TokenStream;\nuse quote::quote;\nuse syn::{parse_macro_input, parse_quote, punctuated::Punctuated, DeriveInput, Path};\n\npub fn derive_extract_component(input: TokenStream) -> TokenStream {\n    let mut ast = parse_macro_input!(input as DeriveInput);\n    let bevy_extract_path: Path = crate::bevy_extract_path();\n    let bevy_ecs_path: Path = bevy_macro_utils::BevyManifest::shared(|manifest| {\n        manifest\n            .maybe_get_path(\"bevy_ecs\")\n            .expect(\"bevy_ecs should be found in manifest\")\n    });\n\n    ast.generics\n        .make_where_clause()\n        .predicates\n        .push(parse_quote! { Self: #FQClone });\n\n    let struct_name = &ast.ident;\n    let (impl_generics, type_generics, where_clause) = &ast.generics.split_for_impl();\n\n    let Some(attr) = ast.attrs.iter().find(|a| a.path().is_ident(\"extract_app\")) else {\n        return syn::Error::new_spanned(\n            &ast.ident,\n            \"ExtractComponent requires #[extract_app(MyAppLabelA, MyAppLabelB)] to specify the target sub-app(s)\",\n        )\n        .to_compile_error()\n        .into();\n    };","sourceCodeStart":1,"sourceCodeEnd":30,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_extract/macros/src/extract_component.rs#L1-L30","documentation":"This expect() panic happens at COMPILE TIME inside the #[derive(ExtractComponent)] macro from bevy_extract. The macro resolves the path to bevy_ecs by scanning the crate manifest (BevyManifest); if 'bevy_ecs' cannot be found as a dependency in the invoking crate's Cargo.toml, maybe_get_path returns None and the derive aborts with 'bevy_ecs should be found in manifest'. It is a build-script/proc-macro environment problem, not a runtime error.","triggerScenarios":"Using #[derive(ExtractComponent)] in a crate whose Cargo.toml does not list bevy_ecs as a dependency; depending on bevy_extract (or bevy_render re-exports) without also pulling bevy_ecs; workspace setups where the dependency is renamed or only present as a transitive dep.","commonSituations":"Splitting a Bevy project into workspace crates and forgetting bevy_ecs in the crate that derives ExtractComponent; using the new bevy_extract crate directly in external code; renaming dependencies in Cargo.toml so manifest path resolution fails.","solutions":["Add bevy_ecs to the invoking crate's Cargo.toml: bevy_ecs = \"<matching version>\" (or via the bevy umbrella crate at the same version).","Keep dependency versions in lockstep with bevy_extract/bevy_render to avoid mixed-version manifest lookups.","If you don't need ECS types in that derive, check whether a re-export path (bevy::ecs) is available and depend on the umbrella bevy crate instead.","Verify the derive is actually the one you intend (bevy_extract's) and that no custom BevyManifest path env overrides break resolution."],"exampleFix":"# before (Cargo.toml of the deriving crate)\n[dependencies]\nbevy_extract = \"0.19\"\n# derive fails: bevy_ecs should be found in manifest\n\n# after\n[dependencies]\nbevy_ecs = \"0.19\"\nbevy_extract = \"0.19\"","handlingStrategy":"validation","validationCode":"# In Cargo.toml of the crate using #[derive(ExtractComponent)]:\n[dependencies]\nbevy_ecs = \"0.19\"   # must match the bevy_extract/bevy version in use\nbevy_extract = \"0.19\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Every crate that derives Bevy macros must list the referenced Bevy subcrates as direct dependencies.","Keep all bevy_* dependency versions identical across the workspace (cargo tree -d to check).","Treat proc-macro 'should be found in manifest' panics as missing-dependency signals, not source bugs."],"tags":["bevy","proc-macro","derive-macro","cargo","compile-time","manifest"],"backgroundTag":"proc-macro-manifest-path-missing","analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-09T01:17:15.007Z"}