Sunday, 7 May 2017

NodeJs. Converting circular structure to json Error

Im want send all connected users data about new connection, but receive error "converting circular structure to JSON" during compilation.

for(var user in squad[_m.data.team].clients){
    if(user == _m.data.client){
      squad[_m.data.team].clients[_m.data.client].send(JSON.stringify({request:0,data:squad[_m.data.team]}));  
    }  
  }

So, I searched for reasons and find that this error formed, when I trying reference object themselfs, but I dont.



via Мишка Картмазов

No comments:

Post a Comment