{"action":"created","issue":{"url":"https://api.github.com/repos/gamestdio/colyseus/issues/66","repository_url":"https://api.github.com/repos/gamestdio/colyseus","labels_url":"https://api.github.com/repos/gamestdio/colyseus/issues/66/labels{/name}","comments_url":"https://api.github.com/repos/gamestdio/colyseus/issues/66/comments","events_url":"https://api.github.com/repos/gamestdio/colyseus/issues/66/events","html_url":"https://github.com/gamestdio/colyseus/issues/66","id":240256207,"number":66,"title":"PM2: Problem starting server with 0.5.0-alpha.6","user":{"login":"Tazer","id":132698,"avatar_url":"https://avatars1.githubusercontent.com/u/132698?v=3","gravatar_id":"","url":"https://api.github.com/users/Tazer","html_url":"https://github.com/Tazer","followers_url":"https://api.github.com/users/Tazer/followers","following_url":"https://api.github.com/users/Tazer/following{/other_user}","gists_url":"https://api.github.com/users/Tazer/gists{/gist_id}","starred_url":"https://api.github.com/users/Tazer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tazer/subscriptions","organizations_url":"https://api.github.com/users/Tazer/orgs","repos_url":"https://api.github.com/users/Tazer/repos","events_url":"https://api.github.com/users/Tazer/events{/privacy}","received_events_url":"https://api.github.com/users/Tazer/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-07-03T20:09:45Z","updated_at":"2017-07-03T20:27:44Z","closed_at":"2017-07-03T20:27:44Z","body":"I'm getting the following error, the error is when running in pm2.\r\nI have the following command to start: `pm2 start index.js --node-args='--harmony --harmony-proxies --use-strict`\r\n\r\n```\r\n1|index    | /var/www/c-c-c-combo/backend/node_modules/colyseus/lib/matchmaking/Process.js:68\r\n1|index    |                 if (availableWorkerIds.length > 0) {\r\n1|index    |                                       ^\r\n1|index    | TypeError: Cannot read property 'length' of undefined\r\n1|index    |     at Object.21837:1 (/var/www/c-c-c-combo/backend/node_modules/colyseus/lib/matchmaking/Process.js:68:39)\r\n1|index    |     at Store.consume (/var/www/c-c-c-combo/backend/node_modules/memshared/lib/Store.js:25:47)\r\n1|index    |     at process.workerHandleIncomingMessage (/var/www/c-c-c-combo/backend/node_modules/memshared/lib/index.js:31:19)\r\n1|index    |     at emitTwo (events.js:111:20)\r\n1|index    |     at process.emit (events.js:191:7)\r\n1|index    |     at process.nextTick (internal/child_process.js:758:12)\r\n1|index    |     at _combinedTickCallback (internal/process/next_tick.js:73:7)\r\n1|index    |     at process._tickCallback (internal/process/next_tick.js:104:9)\r\n```\r\nMy index.js looks like this:\r\n\r\n```\r\nimport * as cluster from 'cluster';\r\nimport chatRoom from './rooms/chat_room';\r\nimport gameRoom from './rooms/game_room';\r\nimport highscoreRoom from './rooms/highscore_room';\r\n\r\n\r\nconst colyseus = require('colyseus');\r\nconst express = require('express');\r\n\r\nconst port = process.env.PORT || 3553;\r\n\r\nconst gameServer = new colyseus.ClusterServer();\r\n\r\ngameServer.register('chat_room', chatRoom);\r\ngameServer.register('game_room', gameRoom);\r\ngameServer.register('highscore_room', highscoreRoom);\r\nif (cluster.isMaster) {\r\n  gameServer.listen(port);\r\n} else {\r\n  console.log('Worker spawned', process.pid);\r\n  const app = express();\r\n  // app.listen(port);\r\n\r\n  // Create HTTP Server\r\n  gameServer.attach({ app });\r\n}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/gamestdio/colyseus/issues/comments/312728018","html_url":"https://github.com/gamestdio/colyseus/issues/66#issuecomment-312728018","issue_url":"https://api.github.com/repos/gamestdio/colyseus/issues/66","id":312728018,"user":{"login":"Tazer","id":132698,"avatar_url":"https://avatars1.githubusercontent.com/u/132698?v=3","gravatar_id":"","url":"https://api.github.com/users/Tazer","html_url":"https://github.com/Tazer","followers_url":"https://api.github.com/users/Tazer/followers","following_url":"https://api.github.com/users/Tazer/following{/other_user}","gists_url":"https://api.github.com/users/Tazer/gists{/gist_id}","starred_url":"https://api.github.com/users/Tazer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tazer/subscriptions","organizations_url":"https://api.github.com/users/Tazer/orgs","repos_url":"https://api.github.com/users/Tazer/repos","events_url":"https://api.github.com/users/Tazer/events{/privacy}","received_events_url":"https://api.github.com/users/Tazer/received_events","type":"User","site_admin":false},"created_at":"2017-07-03T20:27:44Z","updated_at":"2017-07-03T20:27:44Z","body":"@endel ah! did think that the recently added \"cluster\" support was for pm2 , I will try to get it work correctly via `forever` instead. "}}
{"actor":{"display_login":"Tazer"}}