Hello, i’m working with the js client and Playcanvas. The client is correctly created, i’m using the lastest nakama-js.umd.js and correctly imported into the engine.
// initialize code called once per entity
NetworkManager.prototype.initialize = function() {
var client = new nakamajs.Client("defaultkey", "[IP]", "[PORT]");
var currentSession = null;
client.ssl = false;
print("print ho rha hai");
var email = "super@heroes.com";
var password = "batsignal";
var session = client.authenticateEmail({ email: email, password: password });
console.info(session);
};
// update code called every frame
NetworkManager.prototype.update = function(dt) {
};
When i’m trying to connect to my server it throws an error:
Cannot read property 'encode' of undefined
SOLUTION: use this HOTFIX or download the 2.1.3 umd file.
hey @ameza this is a bug with our .umd.js distribution that we are moving away from. I am looking into it but in the meantime could you use our .esm distribution – I believe PlayCanvas supports ES modules.