32 chars · 3 lines
Waiting for input
32 chars · 3 lines
Waiting for input
YAML block troubleshooting
The preloaded example de-indents port by one space: it no longer aligns with the nested service mapping, but it is not far enough left to become a valid top-level key. The parser is forced out of the current block at an impossible position. This tool is free to use. No account or payment is required.
Last updated
When a nested block uses two spaces, returning by only one space does not match either the child or the parent level. That can produce expected block end or similar block-structure parser errors.
The parser often reports the next key because that is where it discovers the previous block cannot continue. Compare the entire surrounding block instead of editing only the highlighted line.
The port key should align with name inside the service mapping.
service:
name: api
port: 8080service:
name: api
port: 8080Common questions
It means the parser expected the current mapping or sequence block to finish cleanly, but the following indentation or token did not fit a valid block boundary.
No. A malformed indentation level or unfinished structure immediately before the highlighted token can be the real cause.
Yes. Leading tabs are invalid block indentation and can make the apparent visual hierarchy differ from the parsed structure.
Debugging a specific YAML issue? Browse YAML troubleshooting.