[ColdBox 5] - messagebox CSS being included when renderData(). JSON formatting issues.

Having slight issue with renderData/messagebox where its including messagebox CSS, and mangling the JSON:

What do I need to update such that the CSS is not included in the render?

I've verified that I have structure to return.

error structure contains a string, created by messagebox

Don't show the CSS! Don't mess up the JSON formatting.

I’ve read https://coldbox.ortusbooks.com/the-basics/event-handlers/rendering-data as well.

The three lines of code that are behaving differently in CB5 vs CB2.x are:

st.error = getInstance('messagebox@cbmessagebox').renderit(); // renderit() also clears the message
event.renderData(data=st,type='JSON');
return st;
  • when I dump the structures on the two different versions, they are identical.

Why do these same three lines of code produce radically different output?