{"record":{"id":"0686c4c85aed15a4","repo":"stride3d/stride","slug":"while-parsing-a-node-did-not-find-expected-node-content","errorCode":null,"errorMessage":"While parsing a node, did not find expected node content.","messagePattern":"While parsing a node, did not find expected node content\\.","errorType":"exception","errorClass":"SemanticErrorException","httpStatus":null,"severity":"error","filePath":"sources/core/Stride.Core.Yaml/Parser.cs","lineNumber":561,"sourceCode":"                        return new Events.SequenceStart(anchorName, tagName, isImplicit, DataStyle.Normal, start, blockSequenceStart.End);\n                    }\n\n                    BlockMappingStart blockMappingStart = GetCurrentToken() as BlockMappingStart;\n                    if (blockMappingStart != null)\n                    {\n                        state = ParserState.YAML_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE;\n                        return new Events.MappingStart(anchorName, tagName, isImplicit, DataStyle.Normal, start, GetCurrentToken().End);\n                    }\n                }\n\n                if (anchorName != null || tag != null)\n                {\n                    state = states.Pop();\n                    return new Events.Scalar(anchorName, tagName, string.Empty, ScalarStyle.Plain, isImplicit, false, start, GetCurrentToken().End);\n                }\n\n                var current = GetCurrentToken();\n                throw new SemanticErrorException(current.Start, current.End, \"While parsing a node, did not find expected node content.\");\n            }\n        }\n\n        /// <summary>\n        /// Parse the productions:\n        /// implicit_document    ::= block_node DOCUMENT-END*\n        ///                                     *************\n        /// explicit_document    ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*\n        ///                                                                *************\n        /// </summary>\n        private Event ParseDocumentEnd()\n        {\n            bool isImplicit = true;\n            Mark start = GetCurrentToken().Start;\n            Mark end = start;\n\n            if (GetCurrentToken() is DocumentEnd)\n            {","sourceCodeStart":543,"sourceCodeEnd":579,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/core/Stride.Core.Yaml/Parser.cs#L543-L579","documentation":"ParseNode reached a point where it expected actual node content (scalar, sequence start, mapping start, or an alias) but found an unexpected token. The parser cannot build any node from what it saw, so it raises SemanticErrorException at the token's span.","triggerScenarios":"Malformed constructs like \"key: ]\" or \"key: }\" where a node is expected, an empty node position inside a flow collection like \"[a, ]\" depending on token state, or truncated YAML ending mid-structure.","commonSituations":"Hand-edited YAML with an unbalanced bracket/brace, merge-conflict markers or truncated files left by failed writes, generating YAML with a template that emits stray closers.","solutions":["Fix the unbalanced or stray bracket/brace at the reported line","Validate the file with a YAML linter/parser before loading","Check for truncated or merge-conflict-corrupted content and restore the full document"],"exampleFix":"// before\nlist: [a, b, ]\nextra: }\n// after\nlist: [a, b]\nextra: value","handlingStrategy":"try-catch","validationCode":"// cheap pre-check for stray closers before a node position\nif (Regex.IsMatch(text, @\":\\s*[\\]}\\]]\")) throw new InvalidDataException(\"Possible stray closing bracket after ':'\");","typeGuard":null,"tryCatchPattern":"try { stream.Load(reader); } catch (SemanticErrorException ex) { throw new YamlConfigException($\"YAML syntax error near {ex.Start}: {ex.Message}\", ex); }","preventionTips":["Lint YAML in CI before deploying configs","Watch for truncated writes / merge-conflict markers","Balance-check brackets when hand-editing"],"tags":["yaml","parser","syntax-error","node-content"],"backgroundTag":"yaml-parse-error","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}