{"record":{"id":"e15b7885162c7156","repo":"bevyengine/bevy","slug":"caching-entries-after-the-first-is-not-supported","errorCode":null,"errorMessage":"Caching entries after the first is not supported, remove the ':' prefix or make this the first entry.","messagePattern":"Caching entries after the first is not supported, remove the ':' prefix or make this the first entry\\.","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/bevy_scene/macros/src/bsn/parse.rs","lineNumber":68,"sourceCode":"    }\n}\n\nimpl Parse for BsnListRoot {\n    fn parse(input: ParseStream) -> Result<Self> {\n        Ok(BsnListRoot(input.parse::<BsnSceneListItems>()?))\n    }\n}\n\nimpl<const ALLOW_FLAT: bool> Parse for Bsn<ALLOW_FLAT> {\n    fn parse(input: ParseStream) -> Result<Self> {\n        let mut entries = Vec::new();\n        if input.peek(Paren) {\n            let content;\n            parenthesized![content in input];\n            while !content.is_empty() {\n                let entry = BsnEntry::parse(&content)?;\n                if matches!(entry, BsnEntry::CachedScene(_)) && !entries.is_empty() {\n                    return Err(syn::Error::new(\n                        content.span(),\n                        \"Caching entries after the first is not supported, remove the ':' prefix or make this the first entry.\",\n                    ));\n                }\n                entries.push(entry);\n            }\n        } else if ALLOW_FLAT {\n            while !input.is_empty() {\n                let entry = BsnEntry::parse(input)?;\n                if matches!(entry, BsnEntry::CachedScene(_)) && !entries.is_empty() {\n                    return Err(syn::Error::new(\n                        input.span(),\n                        \"Caching entries after the first is not supported, remove the ':' prefix or make this the first entry.\",\n                    ));\n                }\n                entries.push(entry);\n                if input.peek(Comma) {\n                    // Not ideal, but this anticipatory break allows us to parse non-parenthesized","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_scene/macros/src/bsn/parse.rs#L50-L86","documentation":"The bsn!/bsn_list! macros (Bevy Scene Notation) parse a ':'-prefixed entry as a cached scene (BsnEntry::CachedScene). Caching is only allowed for the FIRST entry of a BSN list; when a CachedScene appears after other entries inside the parenthesized form, the parser emits this syn::Error at compile time.","triggerScenarios":"Writing bsn!(ComponentA, :\"scene.glb#Scene1\") or any grouped entry list where a ':'-prefixed scene is not the first item.","commonSituations":"Composing scenes where a cached scene asset is appended after components; reordering BSN entries during refactors so the cached asset ends up first-but-one; copy-pasting entry lists.","solutions":["Move the cached scene to the first position: bsn!(:\"scene.glb#Scene1\", ComponentA)","Or remove the ':' prefix if caching of that asset is not needed"],"exampleFix":"// before\nbsn!(\n    (MeshMaterial3d::<StandardMaterial>::default(), :\"model.glb#Scene0\")\n)\n\n// after\nbsn!(\n    (:\"model.glb#Scene0\", MeshMaterial3d::<StandardMaterial>::default())\n)","handlingStrategy":"validation","validationCode":"// Convention check before writing BSN: a ':'-cached entry must be entry #0.\n// Some editors/lints can be configured; simplest is a code-review checklist item:\n// ':' entries: first position only, and must be a string-literal asset path.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the cached (':') scene asset as the first entry whenever you compose BSN lists","Treat ':' as 'cache the whole scene root' — only one such root entry makes sense per list","Read the macro error span: it points at the offending entry position in the source"],"tags":["bevy","bsn","proc-macro","scene","compile-error"],"backgroundTag":"proc-macro-syntax-error","analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}