I spent the last couple of days debugging Socket.io to figure out why the array I was passing in through the emit function (from the client to the server) was showing the message "No Children" when I viewed the array in Quick Watch. In a few minutes I found the code where the data was getting corrupt; JSON.parse method. I took the same data and ran it through Node.js interactive and it was coming back successful so it wasn't making any sense. I then tried to stringify and parse the data myself so I could eliminate the code in Socket.io and received the same results. I created another project to test different scenarios because I knew something had just changed because this was working the day before. At the end of the second day I decided to just pass the data as a concatenated string of data plus ":" and "#" as separators ("reportType:CA#reportDuration:MN#startDate:2005-01-15") so I could use the Array split method to recreate my JS objects on the server side. When I went to view my array I saw the same No Children message. At this point I knew there was data in the array so I just typed, "queryDataIn[0].id" (I recreated id="reportType" and value="CA" for each object in my new method to recreate the object array) and my value showed up. So it appears the latest release of Node.js Tools for Visual Studio which I installed just prior to having the problem is not properly displaying the array contents.
↧