TypeError: u.callback is undefined
Posted: 01 Aug 2019, 06:55
Connector (npm+webpack variant)
------------------------------
URL - http://docs2x.smartfoxserver.com/Exampl ... pm-webpack
I use this url to Integrate sfs into my project. This is phaser gaming project.
1st i install api use this command "npm install sfs2x-api --save".
Then I don't use webpack alternately i use parcel bundler. So i don't know how to remove warning filter in parcel. So i skip warningfilter step
then i import the API like this->
"import * as SFS2X from "sfs2x-api";"
This is the following code to implement SFS connection
I got this Following error, Here i attach the error png's.
------------------------------
URL - http://docs2x.smartfoxserver.com/Exampl ... pm-webpack
I use this url to Integrate sfs into my project. This is phaser gaming project.
1st i install api use this command "npm install sfs2x-api --save".
Then I don't use webpack alternately i use parcel bundler. So i don't know how to remove warning filter in parcel. So i skip warningfilter step
then i import the API like this->
"import * as SFS2X from "sfs2x-api";"
This is the following code to implement SFS connection
import * as SFS2X from "sfs2x-api";
let sfsConn = null;
export default class SfsCon
{
constructor()
{
if(this.sfsConn == null)
{
sfsConn = new SFS2X.SmartFox();
this.config =
{
host : '127.0.0.1',
port : 8080,
zone : 'BasicExample',
debug: true,
};
sfsConn = new SFS2X.SmartFox(this.config);
sfsConn.addEventListener(SFS2X.SFSEvent.CONNECTION, this.onConnection, this);
sfsConn.connect();
}
else
{
return sfsConn;
}
}
onConnection(event)
{
console.log(event);
if (event.success == true)
{
console.log("Connected to SmartFoxServer 2X!");
}
}
}
I got this Following error, Here i attach the error png's.