{"record":{"id":"599b9eafe2dae7c1","repo":"bevyengine/bevy","slug":"asset-source-must-not-contain-a-character","errorCode":null,"errorMessage":"Asset source must not contain a `#` character","messagePattern":"Asset source must not contain a `#` character","errorType":"exception","errorClass":"ParseAssetPathError","httpStatus":null,"severity":"error","filePath":"crates/bevy_asset/src/path.rs","lineNumber":86,"sourceCode":"\nimpl<'a> Display for AssetPath<'a> {\n    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {\n        if let AssetSourceId::Name(name) = self.source() {\n            write!(f, \"{name}://\")?;\n        }\n        write!(f, \"{}\", self.path.display())?;\n        if let Some(label) = &self.label {\n            write!(f, \"#{label}\")?;\n        }\n        Ok(())\n    }\n}\n\n/// An error that occurs when parsing a string type to create an [`AssetPath`] fails, such as during [`AssetPath::parse`].\n#[derive(Error, Debug, PartialEq, Eq)]\npub enum ParseAssetPathError {\n    /// Error that occurs when the [`AssetPath::source`] section of a path string contains the [`AssetPath::label`] delimiter `#`. E.g. `bad#source://file.test`.\n    #[error(\"Asset source must not contain a `#` character\")]\n    InvalidSourceSyntax,\n    /// Error that occurs when the [`AssetPath::label`] section of a path string contains the [`AssetPath::source`] delimiter `://`. E.g. `source://file.test#bad://label`.\n    #[error(\"Asset label must not contain a `://` substring\")]\n    InvalidLabelSyntax,\n    /// Error that occurs when a path string has an [`AssetPath::source`] delimiter `://` with no characters preceding it. E.g. `://file.test`.\n    #[error(\"Asset source must be at least one character. Either specify the source before the '://' or remove the `://`\")]\n    MissingSource,\n    /// Error that occurs when a path string has an [`AssetPath::label`] delimiter `#` with no characters succeeding it. E.g. `file.test#`\n    #[error(\"Asset label must be at least one character. Either specify the label after the '#' or remove the '#'\")]\n    MissingLabel,\n}\n\nimpl<'a> AssetPath<'a> {\n    /// Creates a new [`AssetPath`] from a string in the asset path format:\n    /// * An asset at the root: `\"scene.gltf\"`\n    /// * An asset nested in some folders: `\"some/path/scene.gltf\"`\n    /// * An asset with a \"label\": `\"some/path/scene.gltf#Mesh0\"`\n    /// * An asset with a custom \"source\": `\"custom://some/path/scene.gltf#Mesh0\"`","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/bevyengine/bevy/blob/8d743eb7dc7fcff57a7d5744d0bbf89620b1b145/crates/bevy_asset/src/path.rs#L68-L104","documentation":"ParseAssetPathError::InvalidSourceSyntax: while parsing an asset path string, the source section (the part before ://) contained the label delimiter '#' (e.g. 'bad#source://file.test'). The source name must be a plain identifier without '#'.","triggerScenarios":"Thrown at crates/bevy_asset/src/path.rs:86 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the '#' from the asset source name in the path string","Move any label to the end of the path after a single '#'","Escape or rename source names that legitimately contain special characters"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8d743eb7dc7fcff57a7d5744d0bbf89620b1b145","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}