bevyengine/bevy · error · syn::Error
Currently, caching is only supported for scene assets…
Error message
Currently, caching is only supported for scene assets. Please remove the ':' prefix for now.
What it means
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.
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"
Example fix
// before
bsn!(:{ my_scene_expr });
// after
bsn!({ my_scene_expr }); Defensive patterns
Strategy: validation
Validate before calling
// Rule to enforce before writing BSN: ':' may only precede a string literal // scene asset path. Anything else must be written without the prefix.
Prevention
- Reserve ':' strictly for :"asset.scene" forms until broader caching ships
- Write expressions, function calls, and @components without any prefix
When it happens
Trigger: Prefixing any non-asset scene form with ':' — e.g. :{ some_expr }, :@MySceneComponent, or :some_function() — inside bsn!/bsn_list!.
Common situations: 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.
Related errors
- Caching entries after the first is not supported, remove…
- Cannot cache Scene Components with props/fields
- Cannot cache scene expressions
- Cannot use scene assets without caching, please add the ':'…
- Consts are not currently supported in this position
AI-assisted analysis of bevyengine/bevy@a62cce8c05 (2026-08-20).
Data as JSON: /api/errors/941863a1b35936a6.
Report an issue: GitHub.
Appendix: source
Thrown at crates/bevy_scene/macros/src/bsn/parse.rs:221
}
} else {
if input.peek(Dot) {
let dot_expr = parse_extended_dot_expression(input)?;
BsnEntry::TemplateValue(quote! {#path #dot_expr})
} else {
BsnEntry::TemplateValue(path.into_token_stream())
}
}
}
}
})
}
}
impl Parse for BsnSceneList {
fn parse(input: ParseStream) -> Result<Self> {
let content;
bracketed!(content in input);
Ok(BsnSceneList(content.parse::<BsnSceneListItems>()?))
}
}
impl Parse for BsnSceneListItems {
fn parse(input: ParseStream) -> Result<Self> {
let mut scenes = Vec::new();
let mut commas = Vec::new();
loop {
if input.is_empty() {
break;
}
let value = input.parse::<BsnSceneListItem>()?;
scenes.push(value);
if input.is_empty() {
break;
}
// Try parsing without a comma or -- separator first. This makes autocompleteView on GitHub (pinned to a62cce8c05)