{"record":{"id":"24e339de3359ef74","repo":"stride3d/stride","slug":"did-not-find-expected-document-start","errorCode":null,"errorMessage":"Did not find expected <document start>.","messagePattern":"Did not find expected <document start>\\.","errorType":"exception","errorClass":"SemanticErrorException","httpStatus":null,"severity":"error","filePath":"sources/core/Stride.Core.Yaml/Parser.cs","lineNumber":275,"sourceCode":"                states.Push(ParserState.YAML_PARSE_DOCUMENT_END_STATE);\n\n                state = ParserState.YAML_PARSE_BLOCK_NODE_STATE;\n\n                return new Events.DocumentStart(null, directives, true, GetCurrentToken().Start, GetCurrentToken().End);\n            }\n\n            // Parse an explicit document.\n\n            else if (!(GetCurrentToken() is StreamEnd))\n            {\n                Mark start = GetCurrentToken().Start;\n                TagDirectiveCollection directives = new TagDirectiveCollection();\n                VersionDirective versionDirective = ProcessDirectives(directives);\n\n                var current = GetCurrentToken();\n                if (!(current is DocumentStart))\n                {\n                    throw new SemanticErrorException(current.Start, current.End, \"Did not find expected <document start>.\");\n                }\n\n                states.Push(ParserState.YAML_PARSE_DOCUMENT_END_STATE);\n\n                state = ParserState.YAML_PARSE_DOCUMENT_CONTENT_STATE;\n\n                Event evt = new Events.DocumentStart(versionDirective, directives, false, start, current.End);\n                Skip();\n                return evt;\n            }\n\n            // Parse the stream end.\n\n            else\n            {\n                state = ParserState.YAML_PARSE_END_STATE;\n\n                Event evt = new Events.StreamEnd(GetCurrentToken().Start, GetCurrentToken().End);","sourceCodeStart":257,"sourceCodeEnd":293,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/core/Stride.Core.Yaml/Parser.cs#L257-L293","documentation":"In the explicit-document-start parse state, the parser requires a DocumentStart token ('---') but found some other token. This is raised after directives when the next token is not '---', meaning the document structure is malformed for the state the parser is in.","triggerScenarios":"Input using %YAML or %TAG directives without a following '---' line, e.g. \"%YAML 1.1\\nkey: value\" (missing '---'), or a second document in a stream missing its '---' separator.","commonSituations":"Hand-edited YAML configs that add a %YAML directive but forget the '---' marker, concatenating YAML documents without separators.","solutions":["Add the required '---' document-start marker after any %YAML/%TAG directives","Remove the directives entirely if a plain implicit document was intended","Validate the YAML with a linter before loading"],"exampleFix":"// before\n%YAML 1.1\nkey: value\n// after\n%YAML 1.1\n---\nkey: value","handlingStrategy":"try-catch","validationCode":"// pre-validate directives are followed by '---'\nforeach (var line in File.ReadLines(path))\n    if (line.StartsWith(\"%YAML\") || line.StartsWith(\"%TAG\")) requireDocStartAfterDirective = true;","typeGuard":null,"tryCatchPattern":"try { stream.Load(reader); } catch (SemanticErrorException ex) { throw new YamlConfigException($\"Missing '---' after directives: {ex.Message}\", ex); }","preventionTips":["Always emit '---' after %YAML/%TAG directives","Run a YAML linter in CI on config files","Don't concatenate document headers without separators"],"tags":["yaml","parser","syntax-error","document-start"],"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"}