Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: Cannot call method 'supportsPing' of null #33

Closed
sandstrom opened this issue Apr 4, 2013 · 5 comments
Closed

Uncaught TypeError: Cannot call method 'supportsPing' of null #33

sandstrom opened this issue Apr 4, 2013 · 5 comments

Comments

@sandstrom
Copy link

Our pusher implementation is pretty simple. We use the 2.0 client and the following code to initialise:

var CHANNEL_ID = '...';
var PUSHER_KEY = '...';
var pusher = new Pusher(PUSHER_KEY, { encrypted: true, disableFlash: true });
var channel = pusher.subscribe(CHANNEL_ID);
channel.bind('myEvent', function(data) { ... } );

This is the error we've seen (and the line where it's thrown):

Uncaught TypeError: Cannot call method 'supportsPing' of null

this.unavailableTimer = setTimeout(function() {
e.unavailableTimer && (e.updateState("unavailable"), e.unavailableTimer = null);
}, this.options.unavailableTimeout);
}, t.clearUnavailableTimer = function() {
this.unavailableTimer && (clearTimeout(this.unavailableTimer), this.unavailableTimer = null);
}, t.resetActivityCheck = function() {
this.stopActivityCheck();
if (!this.connection.supportsPing()) { <===================== error thrown here
var e = this;
this.activityTimer = setTimeout(function() {
e.send_event("pusher:ping", {}), e.activityTimer = setTimeout(function() {
e.connection.close();

I haven't reproduced this on my computer, but it's happened for our customers (Chrome 25) and we get the reports via our onError tracking.

Hopefully this is enough to investigate, otherwise feel free to close the issue.

@pl
Copy link
Contributor

pl commented Apr 8, 2013

Thanks for reporting the problem, this seems like an interesting issue - it looks like there's a message coming between closing the connection and connection emitting the "close" event. It would be great to have a stack trace or other debug info, but I understand it's difficult to get for you, since you can't replicate the problem on your side.

Do you ever call the disconnect method on your Pusher instance?

Anyway, I'll try to make sure we don't raise this error anyway, since there seems to be an incorrect execution path in the code.

@sandstrom
Copy link
Author

Yes, I don't have much to go on. Only seen it in Chrome so far (Chrome/26.0.1410.43). Last occurrence was Mon Apr 08 2013 20:18:35 (CEST) on channel id 50b72e76c96b064e39007662.

We never call disconnect.

@pl
Copy link
Contributor

pl commented Apr 11, 2013

We've released a new version (2.0.1) a few moments ago, which should solve your issues. Can you confirm the fix works?

@sandstrom
Copy link
Author

Thats awesome! 🏆

I've pushed it into production. I'll confirm on Monday (never seen it myself, so must wait a while to know if it's reported by our error handling). Should I forget to report back you can simply close this issue after Monday next week.

@tommoor
Copy link

tommoor commented Oct 10, 2013

Guys, I'm still seeing this issue regularly with the latest client (v2.1.2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants