So, I started to define a list with some items that I binding to the UI.
var myItems = [
{ id: 1, name: "Tom", age: 20},
{ id: 2, name: "Jack", age: 23},
{ id: 3, name: "Maria", age: 19},
];
After I bounded the data to the UI I hit F5 and surprise. Visual Studio hit me with an error that doesn’t give you any kind of information about the cause of the error.{
"exception":null,
"error":
{
"description":"Null item"
},
"promise":
{
"_value":
{
"description":"Null item"
},
"_isException":false,
"_errorId":3
},
"id":3
}
This error is thrown by terminate application handler function. Because of this we cannot see any information about the exact line of the error. In the first moment I checked to see if the id field is null or if I bounded correctly, but everything seems to be okay.The next thing that I tried was to rename the id field to something else. In my case I replaced with a field named “key”. When I hit F5 I was surprised that everything was up and running.
In conclusion, when you are using data that are binding to the UI, don’t use reserved names for the fields like “id”.