{"record":{"id":"f60f66299cc1209e","repo":"run-llama/llama_index","slug":"could-not-parse-code-with-language-self-language","errorCode":null,"errorMessage":"Could not parse code with language {self.language}.","messagePattern":"Could not parse code with language (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/node_parser/text/code.py","lineNumber":315,"sourceCode":"        ) as event:\n            text_bytes = bytes(text, \"utf-8\")\n            tree = self._parser.parse(text_bytes)\n\n            if (\n                not tree.root_node.children\n                or tree.root_node.children[0].type != \"ERROR\"\n            ):\n                chunks = [\n                    chunk.strip()\n                    for chunk in self._chunk_node(tree.root_node, text_bytes)\n                ]\n                event.on_end(\n                    payload={EventPayload.CHUNKS: chunks},\n                )\n\n                return chunks\n            else:\n                raise ValueError(f\"Could not parse code with language {self.language}.\")\n\n        # TODO: set up auto-language detection using something like https://github.com/yoeo/guesslang.\n","sourceCodeStart":297,"sourceCodeEnd":318,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/node_parser/text/code.py#L297-L318","documentation":"Error \"Could not parse code with language {self.language}.\" thrown in run-llama/llama_index.","triggerScenarios":"Thrown at llama-index-core/llama_index/core/node_parser/text/code.py:315 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the language parameter matches a supported tree-sitter grammar.","Check the code is valid for the configured language; fall back to SentenceSplitter for unparseable input."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}