Unity-Technologies/UnityCsReference · error · JSONParseException
Missing dict entry delimiter ':' at {}
Error message
Missing dict entry delimiter ':' at {} What it means
After parsing a string key and skipping whitespace, ParseDict requires ':' to separate key from value; if the current char is not ':' it throws JSONParseException ("Missing dict entry delimiter ':' at <pos>"). This catches objects where the colon was omitted or replaced, e.g. {"k" "v"}.
Source
Thrown at Editor/Mono/AssetStore/Json.cs:498
}
}
Next();
return new JSONValue(arr);
}
private JSONValue ParseDict()
{
Next();
SkipWs();
Dictionary<string, JSONValue> dict = new Dictionary<string, JSONValue>();
while (cur != '}')
{
JSONValue key = ParseValue();
if (!key.IsString())
throw new JSONParseException("Key not string type at " + PosMsg());
SkipWs();
if (cur != ':')
throw new JSONParseException("Missing dict entry delimiter ':' at " + PosMsg());
Next();
dict.Add(key.AsString(), ParseValue());
SkipWs();
if (cur == ',')
{
Next();
SkipWs();
}
}
Next();
return new JSONValue(dict);
}
static readonly char[] endcodes = { '\\', '"' };
private JSONValue ParseString()
{
string res = "";View on GitHub (pinned to 225b0fbdb5)
Solutions
- Ensure each key/value pair uses a colon: "key": value.
- Generate JSON with a serializer instead of editing by hand.
- Validate with a strict parser before runtime use.
Example fix
// before
// { "width" 100 }
// after
// { "width": 100 } Defensive patterns
Strategy: validation
Validate before calling
// Ensure every object key is followed by ':' and a value. // Best enforced by generating JSON with a serializer.
Try / catch
try { v = JSON.Parse(json); }
catch (JSONParseException ex) { /* position points at where ':' was expected */ throw; } Prevention
- Use a real serializer to emit JSON.
- Validate hand-written JSON in a strict parser before runtime.
- Treat a missing-colon error as a generation bug, not a runtime condition.
When it happens
Trigger: Object literal missing the colon between key and value; colon replaced by another separator; whitespace-only corruption between key and value.
Common situations: Hand-edited JSON; templating that dropped the colon; copy/paste artifacts.
Related errors
- Key not string type at {}
- Cannot parse json value starting with '{}' at {}
- End of json while parsing at {}
- missing '"' to end string at {}
- End of json while parsing while parsing string at {}
AI-assisted analysis of Unity-Technologies/UnityCsReference@225b0fbdb5 (2026-08-13).
Data as JSON: /api/errors/782fec485debba45.
Report an issue: GitHub.