I am seeing this relevant post but am having trouble figuring out exactly what was changed:
https://discuss.colyseus.io/topic/298/types-of-undefined-in-reflection-js-error-in-unity/1
I am seeing this relevant post but am having trouble figuring out exactly what was changed:
https://discuss.colyseus.io/topic/298/types-of-undefined-in-reflection-js-error-in-unity/1
Hi, I'm running into a persistent error when trying to run a colyseus server. It starts up fine, but when I try to connect to the server from the client, I get the following error:
> ts-node src/index.ts
[gltd-server] running environment: local
~you are now globally limited~
[gltd-server] Listening on 2657
TypeError: Cannot read property 'types' of undefined
at Function.Reflection.encode (/Users/brianableson/gltd/globally.ltd/server/node_modules/@colyseus/schema/src/Reflection.ts:96:47)
at SchemaSerializer.handshake (/Users/brianableson/gltd/globally.ltd/server/node_modules/colyseus/lib/serializer/SchemaSerializer.js:57:70)
at Club.<anonymous> (/Users/brianableson/gltd/globally.ltd/server/node_modules/colyseus/lib/Room.js:292:136)
at Generator.next (<anonymous>)
at fulfilled (/Users/brianableson/gltd/globally.ltd/server/node_modules/colyseus/lib/Room.js:5:58)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
I am closely following this example.
Here is my current package.json
file:
{
"name": "globally-ltd-game-server",
"version": "0.0.1",
"description": "",
"main": "index.js",
"scripts": {
"start-local": "NODE_ENV=local onchange 'src/**.ts' -i -d 1000 -- ts-node src/index.ts",
"start-ts": "ts-node src/index.ts",
"start": "ts-node src/index.ts",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@types/cors": "0.0.33",
"@types/express": "^4.17.6",
"@types/node": "^13.11.1",
"onchange": "^3.3.0",
"ts-node": "^7.0.1",
"typescript": "^3.8.3"
},
"dependencies": {
"colyseus": "^0.12.6",
"cors": "^2.8.1",
"express": "^4.14.0",
"onchange": "^3.3.0"
}
}
I'm new to typescript, so i'm guessing this is a noobish problem but i'm having trouble googling for the error. Thanks so much for your help in advance!