{"record":{"id":"1eca97d4330e9b67","repo":"bevyengine/bevy","slug":"a-was-found-before-an-opening","errorCode":null,"errorMessage":"a ']' was found before an opening '['","messagePattern":"a '\\]' was found before an opening '\\['","errorType":"exception","errorClass":"ParseError","httpStatus":null,"severity":"error","filePath":"crates/bevy_reflect/src/path/parse.rs","lineNumber":33,"sourceCode":"/// A parse error for a path string.\n#[derive(Debug, PartialEq, Eq, Error)]\nenum Error<'a> {\n    #[error(\"expected an identifier, but reached end of path string\")]\n    NoIdent,\n\n    #[error(\"expected an identifier, got '{0}' instead\")]\n    ExpectedIdent(Token<'a>),\n\n    #[error(\"failed to parse index as integer\")]\n    InvalidIndex(#[from] ParseIntError),\n\n    #[error(\"a '[' wasn't closed, reached end of path string before finding a ']'\")]\n    Unclosed,\n\n    #[error(\"a '[' wasn't closed properly, got '{0}' instead\")]\n    BadClose(Token<'a>),\n\n    #[error(\"a ']' was found before an opening '['\")]\n    CloseBeforeOpen,\n}\n\npub(super) struct PathParser<'a> {\n    path: &'a str,\n    remaining: &'a [u8],\n}\n\nimpl<'a> PathParser<'a> {\n    pub(super) fn new(path: &'a str) -> Self {\n        let remaining = path.as_bytes();\n        PathParser { path, remaining }\n    }\n\n    fn next_token(&mut self) -> Option<Token<'a>> {\n        let to_parse = self.remaining;\n\n        // Return with `None` if empty.","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_reflect/src/path/parse.rs#L15-L51","documentation":"Parse variant of the reflect path parser signaling an unbalanced ']': a closing bracket token was encountered while no '[' was currently open. This is a structural error in the path string (e.g. 'foo]' instead of 'foo[0]'), not a bad token value; rewrite the path so every ']' is preceded by a matching '['.","triggerScenarios":"Thrown at crates/bevy_reflect/src/path/parse.rs:33 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the stray ']'","Add the missing opening '[' before it"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}