this.pingIntervalTimer.refresh is not a function

See original GitHub issue

Describe the bug socket.js:108 Uncaught TypeError: this.pingIntervalTimer.refresh is not a function at Socket.onPacket (socket.js:108)

To Reproduce engine.io: 6.1.0 engine.io-client: 6.1.1 socket.io: 4.4.0 socket.io-client: 4.4.0

Platform:

  • OS: windows 10

Additional context Adding console.log(typeof this.pingIntervalTimer) just before line 108 shows that it’s a number, not a Timer.

this.pingIntervalTime.refresh() was added here it seems: https://github.com/socketio/engine.io/commit/37474c7e67be7c5f25f9ca2d4ea99f3a256bd2de

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
JeffWindercommented, Dec 8, 2021

I think it would be best to explicitly import setTimeout and clearTimeout from Node’s timers module, by adding this in lib/socket.ts: import { setTimeout, clearTimeout } from "timers"; That would make sure compilers don’t mistaken those functions for javascript timers, of which setTimeout doesn’t have a refresh function. Hence the error in my scenario.

I can also make a PR for that tomorrow if you like.

0reactions
darrachequesnecommented, Dec 14, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

this.pingIntervalTimer.refresh is not a function · Issue #4390 ...
Describe the bug There seems to be some dependency-issues: /app/node_modules/browser-sync/node_modules/engine.io/build/socket.js:109 this.
Read more >
socket.io TypeError: socket.on is not a function - Stack Overflow
To fix that you can just add socket to the arguments on your callback function. Like this: io.on('connection',function(socket) { console.
Read more >
Introduction to Sockets.IO in Node.js - GeeksforGeeks
Earlier, websites used to reload every-time a resource was requested. ... the client to know when the other one is not responding anymore....
Read more >
"TypeError: require(...).listen is not a function" in socket.io
In this video I have shown "TypeError: require(...).listen is not a function "that you might face with connecting to ...
Read more >
socket.io - npm
IO client will not be able to connect to a WebSocket server (like ... the Server to socket.io , and not the express...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found