Some third-party tools may insert "invisible" characters into the message you send, and this can sometimes make the message difficult to parse.
For example this:
ComfyJS.onChat = ( user, message, flags, self, extra ) => {
console.log(message.split(" "))
}
can output this:

or this:

So far I have found this working fix:
message = message.replace(" "," ").replace(/[\uD800-\uDFFF]/gi, []).trim()