Error parsing nkruntime.MatchMessage

Json.Parse(message.data.toString()) is working correctly in Nakama version 3.9 but not working in Nakama 3.11.

Changelog says data type is changed from string to Uint8Array. but Uint8Array.toString() method not working on undefined object.

I tried to convert to string using new TextDecoder().decode(message.data) but I get the error TextDecoder is not defined

What am i doing wrong?

Can you please share a received raw data, console.log(message) output for example

logger.debug(message) => "Object"
String.fromCharCode.apply(null, message.data) => ""
message.data.length => 0
message.data.bytelength => 863

Also I wrote the Uint8Array extension method to convert it to a string, but it says that such a method could not be found for this object.

ouch, server side, try this JSON.parse(nk.binaryToString(message.data)) please

1 Like

Omg. Thank you. But I wasted my hours :frowning:

2 Likes