Uncaught:RangeError:Maximum call stack size exceeded

The reason for this error is that I have read some of the past topics, and I got a circular reference in the data, but I need a little bit of help from the goJS team.
1.The data structure is:
Is this a circular reference? Here from:1 is the init type. But is it actually the object whose key is 1? A bit confused
2. There is a problem with this stack overflow, which aspect to check for for goJS. (Of course, in javascript, there is usually an infinite loop)
3. If it is really the first question, then how to solve it? Because this data I need to keep


Please show the stack – what did you call to produce that error.

There is no problem with the data that you show.

Thanks Reply
The problem arises because I show a batch of data about 5000 nodes 5000 side data. Then there are many such "from:a to:b from:b to :c " data structures, using:
var obj = {

myDiagram.model = go.Model.fromJson(obj)

That model data looks fine. What is your Diagram.layout? Which browser are you using? Do you have that problem in other browsers?

First answer your question:
Browser is chrome 68.+version layout is “ForceDirectedLayout”
other browsers Edge error is Out of stack space Same

I have gone through many tests , So I think the problem is in the data, but it is difficult to determine what the problem is from the data display, because it conforms to the JSON format and some of the formatting issues described in the documentation.

If you are convenient, I can send the data mail to you. The problem of stack overflow is 100% recurring.

Still waiting, I hope to get your reply.

It’s very late here now. But you can send the JSON file to GoJS at our domain, nwoods.com.

Sorry, I forgot the time difference.
I didn’t find the option to send to your team,
so you have time to continue this topic.

Send the file to us by email. Our address is GoJS at our domain, nwoods.com.

This error is almost always means you have a problem with recursion in JavaScript code, as there isn’t any other way in JavaScript to consume lots of stack. Sometimes calling a recursive function over and over again, causes the browser to send you Maximum call stack size exceeded error message as the memory that can be allocated for your use is not unlimited.

Be considerate while calling functions , also dry run is the best practice to prevent them. It’s possible to cause infinite recursion in a fully promisified code, too. That can happen if the promises in a chain don’t actually perform any asynchronous execution , in which case control never really returns to the event loop, even though the code otherwise appears to be asynchronous. That’s when it’s useful to wrap your recursive function call into a -

  • setTimeout
  • setImmediate or
  • process.nextTick

In some programming languages this can be solved with tail call optimization, where the recursion call is transformed under the hood into a loop so no maximum stack size reached error exists.