mattstyles / koa-socket

Sugar for connecting socket.io to a koa instance
242 stars 50 forks source link

Error on listen #15

Closed ElegantScripting closed 8 years ago

ElegantScripting commented 8 years ago

I get this error upon running: "[0] Error: Invalid listen argument: [object Arguments]"

But my code looks totally fine:

import koa from "koa";
import koaStatic from "koa-static";
import koaSocket from "koa-socket";

try {
  const app = new koa();
  const host = process.env.HOST || "localhost";
  const port = process.env.PORT || 8000;

  app.use(koaStatic("dist"));

  var io = new koaSocket();
  io.attach(app);

  app.listen(port, () => {
    console.info(`[Koa] Server is listening on http://${host}:${port}`);
  });
} catch (error) {
  console.error(error.stack || error);
}
mattstyles commented 8 years ago

which version of koa-socket are you using?

There have been some changes around that area for v4.1

mattstyles commented 8 years ago

Just pushed up 4.2.1, I think that should solve the problem

chr33s commented 8 years ago

confirmed working after 4.3.0 update