Wednesday, 5 April 2017

Socket.io-redis fatals with Identifier 'sendAck' has already been declared

Just installed

"socket.io-redis": "latest",

and when trying to run my server i am getting

  /home/htdocs/socket/server/node_modules/socket.io-redis/index.js:258
          }
          ^
  SyntaxError: Identifier 'sendAck' has already been declared
      at Object.exports.runInThisContext (vm.js:76:16)
      at Module._compile (module.js:542:28)
      at Object.Module._extensions..js (module.js:579:10)
      at Module.load (module.js:487:32)
      at tryModuleLoad (module.js:446:12)
      at Function.Module._load (module.js:438:3)
      at require (internal/module.js:20:19)
      at Object.<anonymous> (/home/htdocs/socket/server/server.js:47:5)
      at Module._compile (module.js:570:32)
      at Object.Module._extensions..js (module.js:579:10)

no custom logic, just

require('socket.io-redis')({
    host: 'localhost',
    port: 6379
})

in code, more of this this code was fully function for a month ago, i went for a vocation, came back, did npm install and server is fataling.

Update:

If i run server in fork mode (i am using PM2), not in cluster, it seems to work fine, but it's not a solution. Also server works fine if i just comment out socket.io-redis module, and still run in cluster mode, but i need socket.io-redis package, so it's not a solution too.



via Nerfair

No comments:

Post a Comment