Describe the bug
The plugin fails to load tokens and surfaces the error t.name.split is not a function when a token in the JSON has a name field whose value is not a string (e.g. a number). The whole token load fails with no indication of which token caused the issue. Reported by a customer, reproduced 100% on v2.11.5.
To Reproduce
Steps to reproduce the behavior:
- Host the JSON from the "JSON" section below on a public URL (e.g. a public GitHub Gist).
- In the plugin, go to Settings → Add new sync → URL.
- Paste the raw URL and click Save.
- See error: red banner reading
t.name.split is not a function. No tokens load.
Expected behavior
Either ignore the non-spec name field on tokens, or surface a clear validation error identifying which token has the bad name value. Currently the token load fails entirely with no diagnostic info.
Screenshots or Screencasts
JSON (optional)
{
"global": {
"color": {
"primary": { "$value": "#ff0000", "$type": "color", "name": 123 }
}
},
"$themes": [],
"$metadata": {}
}
Describe the bug
The plugin fails to load tokens and surfaces the error
t.name.split is not a functionwhen a token in the JSON has anamefield whose value is not a string (e.g. a number). The whole token load fails with no indication of which token caused the issue. Reported by a customer, reproduced 100% on v2.11.5.To Reproduce
Steps to reproduce the behavior:
t.name.split is not a function. No tokens load.Expected behavior
Either ignore the non-spec
namefield on tokens, or surface a clear validation error identifying which token has the badnamevalue. Currently the token load fails entirely with no diagnostic info.Screenshots or Screencasts
JSON (optional)
{ "global": { "color": { "primary": { "$value": "#ff0000", "$type": "color", "name": 123 } } }, "$themes": [], "$metadata": {} }