Today I updated from nakama 3.5 to nakama 3.12 and encountered the following error message:
{"level":"error","ts":"2022-06-04T16:00:00.799Z","caller":"server/runtime_javascript.go:517","msg":"JavaScript runtime function raised an uncaught exception","mode":"rpc","id":"initsession","error":"TypeError: expects string at github.com/heroiclabs/nakama/v3/server.(*runtimeJavascriptNakamaModule).streamUserJoin.func1 (native)"}
The typescript code I have looks like this and should be pretty straight forward:
You’re missing a parameter added sometime in between 3.5.0 and 3.12.0. Some code working in one version and not a newer one is always worth a trip to the docs first - Nakama: Function Reference | Heroic Labs Documentation
Seems like all the parameters are now required
So I’m missing the status field
The typescript function still lists the parameters as optional though:
So it would be cool if those could be updated
Also the order of the arguments was changed? That would be even more urgent to fix
As with the order in the document I would get ts errors.
After playing around a bit more I also noticed that the required arguments aren’t required at all and that my error actually comes from the fact that my setup in unity no longer works after the update.
(I’m calling the rpc before the socket realizes it’s been connected and therefore I’m sending the rpc without user and session id. )