Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uncaught TypeError: Cannot call method 'onClose' of null

Iam working on node.js chat application, i've hosted the node.js on IIS in windows. my intention is to include the node.js in Asp.net mvc as explained by Jon Galloway for performing chatting( text, audio ,video ) in asp.net web application.

my Installation details:
iisnode.js - iisnode-full-iis7-v0.2.3-x86
node.js - node-v0.8.19-x86
express.js version - 3.1.0
socket.io version - 0.9.13
on windows 7 32 bit system with IIS 8.0 express

I've successfully hosted the node.js on IIS, and run the samples

But when i start coading socket.io i got stuck..

when i start connecting with client browser to server, i got an error at client browser saying
Uncaught TypeError: Cannot call method 'onClose' of null socket.io.js:1771

In my server app iam using socket.io configuration as

io.configure(function () {
    io.set('transports', [    
           'xhr-polling'
         , 'jsonp-polling'
      ]);
        io.set("polling duration", 10); 
        if (process.env.IISNODE_VERSION) {
            io.set('resource', 'node/socket.io'); 
        }
    });

Is this issue related to versions iam using (express, and socket.io node.js) Or in my coading, any idea about the issue please help me.

thank you.

like image 940
Kasi Avatar asked Mar 08 '13 14:03

Kasi


1 Answers

I think it's because you didn't set the resource path in the client socket.io configuration.

socket = io.connect('http://myurl/node/socket.io', { resource : 'node/socket.io' })
like image 97
Unitech Avatar answered Nov 09 '22 13:11

Unitech