socket.io icon indicating copy to clipboard operation
socket.io copied to clipboard

why this error is coming

Open rahul23134 opened this issue 14 years ago • 3 comments

I used the socket.io.client in my node script for making simulate browser client in my node.js, when i am including by io=require('./socket.io.client').io,

it is giving me this error :

node.js:178 throw e; // process.nextTick error, or 'error' event on first tick ^ TypeError: Cannot read property 'indexOf' of undefined at /home/reach121/socket7youngib/lib/socket.io.client.js:1023:24 at Object. (/home/reach121/socket7youngib/lib/socket.io.client.js:1225:2) at Module._compile (module.js:404:26) at Object..js (module.js:410:10) at Module.load (module.js:336:31) at Function._load (module.js:297:12) at require (module.js:348:19) at Object. (/home/reach121/socket7youngib/lib/youngib-client.js:3:4) at Module._compile (module.js:404:26) at Object..js (module.js:410:10)

rahul23134 avatar Dec 19 '11 07:12 rahul23134

Looks, like you are trying to use client-library which is targeted for in-browser use, not in node.js.

cris avatar Dec 19 '11 10:12 cris

Yes, any suggestion for using in node.js

rahul23134 avatar Dec 19 '11 12:12 rahul23134

  1. This is not a bug, please ask such questions in the mailing list
  2. You need to require socket.io not socket.io-client

sri-rang avatar Dec 20 '11 07:12 sri-rang