Uncaught RangeError: Maximum call stack size exceeded

I start getting this error, the second time I try to update the model with my latest updated data.
…say…agDiagram.model = go.Model.fromJson(agDiagramData);

I used to get this error earlier, that time the reason was that my nodeDataArray had duplicate entries. Currently both my link&nodeDataArrays look good. Also, I don’t have any anonymous function.

Do you have any clue on fixing/debugging this issue?

Uncaught RangeError: Maximum call stack size exceeded
at Object.isArray (go_lic.js:17)
at Q.F.replaceJsonObjects.F.Ft (go_lic.js:292)
at Q.F.replaceJsonObjects.F.Ft (go_lic.js:292)
at Q.F.replaceJsonObjects.F.Ft (go_lic.js:292)

Without more information, I’m not sure we can help you. Maximum call stack size exceeded suggests that an infinite loop is occuring, for whatever reason.

Is the value of agDiagramData a valid JSON-formatted string?

If it isn’t, I could see that causing problems. For example, if it’s a JavaScript object, its properties and its Arrays (if any) had better follow the requirements of JSON-formatted text – no shared or cyclical references, and only datatypes that JSON knows about: Objects, Arrays, numbers, strings, booleans.

Yes @walter, the value of agDiagramData is always a valid JSON-formatted string. But don’t understand, why this issue is coming up.

Most of the time, the agDiagramData will be same, will that be causing the issue? I mean, even though there is no difference in the current model and the updated model, I am calling “agDiagram.model = go.Model.fromJson(agDiagramData);” always.

My issue got resolved by adding stringify to the JSON again before applying it to the model. i.e., “agDiagram.model = go.Model.fromJson(agDiagramData);”

Thanks!

thanks very much.