Debug node shows object object

Hmm, I can't find the debug message where this occurred but htere are times when I set up the debug node to show a complete msg and the debug window shows an unexpandable object object. Has anyone one else run into this?

Sounds like you are seeing the string "[Object Object]" (which is why it's not expandable). Somewhere along the flow, an incoming object was converted to a string -- here are a couple of ways that could happen in the Javascript language:

> var test = {};
undefined
> test
{}
> test.toString()
'[object Object]'
> "" + test
'[object Object]'

Thanks, that's helpful! I'll keep that in mind when I see it next time and see if I can fix that. I may have fixed it this time and not realized that is what I did.

Picking up on this thread:
How can I avoid the [object Object] display in the debug widow?

When I define & assign an object literally, it expands correctly in the debug pane:

msg.payload = {a:"aaa",b:5};

Shows as
image

However, if I construct the object dynamically, e.g.:

function tmpObj() {
    this.a = "aaa";
    this.b = 5;
}
msg.payload = new tmpObj();

It shows
image

Note that when I change the debug node display to "complete msg object", the object unfolds correctly:
image

Any clue, anyone?

Json stringify could be an option

Wow, thanks for the quick answer!
Doing JSON stringify and then parse does solve the issue.
Thanks!

Though I wonder what is the root cause of this, and whether I can avoid this workaround, since the object can be very large, and this will be replicating it twice