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

  1. Ensure each key/value pair uses a colon: "key": value.
  2. Generate JSON with a serializer instead of editing by hand.
  3. 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

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


AI-assisted analysis of Unity-Technologies/UnityCsReference@225b0fbdb5 (2026-08-13). Data as JSON: /api/errors/782fec485debba45. Report an issue: GitHub.