{"record":{"id":"941863a1b35936a6","repo":"bevyengine/bevy","slug":"currently-caching-is-only-supported-for-scene-ass","errorCode":null,"errorMessage":"Currently, caching is only supported for scene assets. Please remove the ':' prefix for now.","messagePattern":"Currently, caching is only supported for scene assets\\. Please remove the ':' prefix for now\\.","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/bevy_scene/macros/src/bsn/parse.rs","lineNumber":230,"sourceCode":"        } else {\n            None\n        };\n\n        let err_if_cached = |msg: &str| {\n            if let Some(colon) = cached {\n                Err(syn::Error::new(colon.span(), msg))\n            } else {\n                Ok(())\n            }\n        };\n\n        // It may seem odd how this is checking LitStr again\n        // and how there doesn't seem to be a need for all the specific `err_if_cached`\n        // in later code. But since caching is planned, and will very likely\n        // have the limitations which are ensured by the other errors below,\n        // this is its own block so its very simple to remove once caching is implemented.\n        if !input.peek(LitStr) {\n            err_if_cached(\"Currently, caching is only supported for scene assets. Please remove the ':' prefix for now.\")?;\n        }\n\n        Ok(if input.peek(LitStr) {\n            let path = input.parse::<LitStr>()?;\n            if cached.is_none() {\n                return Err(syn::Error::new(\n                    path.span(),\n                    \"Cannot use scene assets without caching, please add the ':' prefix.\",\n                ));\n            }\n            BsnScene::Asset(path)\n        } else if input.peek(Brace) {\n            err_if_cached(\"Cannot cache scene expressions\")?;\n            BsnScene::Expression(braced_tokens(input)?)\n        } else if input.peek(At) {\n            input.parse::<At>()?;\n            let sc = input.parse::<BsnType>()?;\n            if sc.fields.len() > 0 {","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_scene/macros/src/bsn/parse.rs#L212-L248","documentation":"In BsnScene::parse, the ':' cache prefix is consumed first; if the next token is NOT a string literal (the scene-asset form), the parser immediately rejects it with this message. Caching is currently implemented only for scene assets (\":\\\"path.glb\\\"\"); the source comment notes broader caching is planned and this guard block exists to be removed once real caching lands.","triggerScenarios":"Prefixing any non-asset scene form with ':' — e.g. :{ some_expr }, :@MySceneComponent, or :some_function() — inside bsn!/bsn_list!.","commonSituations":"Assuming BSN caching works for inline expressions or scene components because it works for asset paths; migrating macros where ':' was used as a namespace separator; early adoption of BSN syntax while caching support is partial.","solutions":["Remove the ':' prefix — only string-literal scene assets can be cached today","If you wanted a cached asset, make the entry a string literal: :\"scene.glb#Scene0\""],"exampleFix":"// before\nbsn!(:{ my_scene_expr });\n\n// after\nbsn!({ my_scene_expr });","handlingStrategy":"validation","validationCode":"// Rule to enforce before writing BSN: ':' may only precede a string literal\n// scene asset path. Anything else must be written without the prefix.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Reserve ':' strictly for :\"asset.scene\" forms until broader caching ships","Write expressions, function calls, and @components without any prefix"],"tags":["bevy","bsn","proc-macro","scene-caching","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"}