"An attempt was made to use an object that is not, or is no longer, usable" error

3,666 views
Skip to first unread message

Jeff

unread,
Dec 4, 2011, 4:33:12 PM12/4/11
to Socket.IO
I just deployed a Node.js/Socket.IO web app, and sometimes I'll get
automated Javascript error reports saying:

uncaught exception: [Exception... "An attempt was made to use an
object that is not, or is no longer, usable" code: "11" nsresult:
"0x8053000b (NS_ERROR_DOM_INVALID_STATE_ERR)" location: "http://
xxx.xxx.xxx.xxx/socket.io/socket.io.js Line: 2323"]
File:
Line: 0

Note: the IP address has been redacted

The socket.io.js file header says:
/*! Socket.IO.js build:0.8.7, development. Copyright(c) 2011
LearnBoost <d...@learnboost.com> MIT Licensed */

Line 2323 is:
this.websocket.send(data);

from this chunk of code:

WS.prototype.send = function (data) {
this.websocket.send(data);
return this;
};

Any idea what might be causing the issue?

laxmikant

unread,
Jun 28, 2012, 12:06:38 AM6/28/12
to sock...@googlegroups.com
Hi David,  Jeff,

       Most of the time I came across this issue in javascript(jquery).  The unique & best solution is to use (Javascript's) Closure.
This is quite easy to understand here. http://jibbering.com/faq/notes/closures/. it does confuse the devs from time to time.
Anyway really nice to use.
             Any suggestions are welcome..

Laxmikant

On 06/14/2012 05:30 PM, David Fooks wrote:
I'm seeing the same thing but for 


  WS.prototype.close = function () {
    this.websocket.close();
    return this;
  };

Did you ever find a solution?
Reply all
Reply to author
Forward
0 new messages