Sometimes the crash isn't your code — it's a file your code reads. A config.json, a data file, a plugin's YAML config: one stray comma or a rogue tab, and the parser refuses the whole file. The good news is these errors are the most precise you'll ever get. They point at the exact spot. This guide teaches you to read that pointer and fix what it's pointing at.
| At a glance | |
|---|---|
| Symptom | Crash while loading a .json / .yml config or data file |
| The gift | The error names the line and column of the mistake |
| Fix | Go to that spot, correct the syntax, restart |
JSON: the position is in the message
A trailing comma — a comma after the last item — is the classic JSON mistake. Here's a config.json with one, parsed two ways.
Node (JSON.parse) prints the offending line and puts a caret under it:
"owners": ["123",]
^
SyntaxError: Unexpected token ']', ..."": ["123",]... is not valid JSON
Python (json.load) gives you coordinates — line, column, and character offset:
json.decoder.JSONDecodeError: Expecting value: line 4 column 20 (char 57)
line 4 column 20 is not a hint — it's an address. Open the file, go to line 4, look at column 20, and the problem is right there. Read the pointer first, every time, before re-reading the whole file.
The JSON mistakes you'll actually hit
| Mistake | Looks like |
|---|---|
| Trailing comma | ["a", "b",] or {"x": 1,} |
| Missing comma | {"a": 1 "b": 2} |
| Single quotes | {'name': 'bot'} — JSON requires double quotes |
| Unquoted key | {name: "bot"} — keys must be quoted |
| Comments | // like this — JSON has none; delete them |
| Trailing/missing bracket | one too many or too few } / ] |
YAML: whitespace is the syntax
YAML is what most Minecraft plugins use for their configs, and its rules are about indentation. Two mistakes dominate.
Tabs. YAML forbids tabs for indentation — spaces only. A single tab produces:
yaml.scanner.ScannerError: while scanning for the next token
found character '\t' that cannot start any token
in "config.yml", line 3, column 1
Inconsistent indentation. Lines that should line up but don't:
yaml.parser.ParserError: while parsing a block mapping
expected <block end>, but found '<block mapping start>'
in "config.yml", line 3, column 2
Again — the line 3, column 1 at the bottom is the exact spot. YAML errors read a little more verbosely than JSON, but the last two lines are always "which file, which line and column."
The YAML mistakes you'll actually hit
| Mistake | Fix |
|---|---|
| A tab anywhere in indentation | Replace every tab with spaces |
| Uneven indentation | Items at the same level need the same number of spaces |
| No space after a colon | key:value → key: value |
| An unquoted special value | Wrap values with :, #, % or leading symbols in quotes |
Prevention
- Edit in the File Manager. Its editor uses the same engine as VS Code — it highlights the structure and warns you if you save a file with syntax errors, catching most of these before they ever reach your app.
- Change one thing, then test. After editing a config, restart and watch the console. A small, checked change is easy to undo; ten changes at once hide which one broke it.
- Copy the pointer into your search. "line 4 column 20" tells you where; jump straight there instead of re-reading the file top to bottom.
💡 Tip: For Minecraft plugin configs specifically — which are all YAML — the same rules apply: spaces not tabs, consistent indentation, a space after every colon. The plugin loads its config the moment the server starts, so a broken
.ymlshows up right in the console. See Editing plugin configs safely.