"callback" argument must be a function
See original GitHub issueI’m getting the following error after starting the server:
TypeError: "callback" argument must be a function
at exports.setTimeout (timers.js:327:11)
at WebSocketConnection.setKeepaliveTimer (pathToProject/node_modules/websocket/lib/WebSocketConnection.js:215:32)
at WebSocketConnection.handleSocketData (pathToProject/node_modules/websocket/lib/WebSocketConnection.js:263:10)
at emitOne (events.js:96:13)
at TLSSocket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at TLSSocket.Readable.push (_stream_readable.js:134:10)
at TLSWrap.onread (net.js:548:20)
I’m using version 6.9.1 of node.
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
TypeError: "callback" argument must be a function
Background. setInterval expects a function as the first parameter. In your code setInterval(upload_random_image(), 10000);.
Read more >TypeError: callback is not a function in JavaScript | bobbyhadz
The "callback is not a function" error occurs when we define a callback parameter to a function, but invoke the function without passing...
Read more >TypeError: "callback" argument must be a function when ...
Works when not running with the newrelic agent. Fails when the agent is enabled. TypeError: "callback" argument must be a function at setTimeout ......
Read more >“callback” argument must be a function Node.js - iTecNote
Node.js – “callback” argument must be a function Node.js. node.js. I'm getting this error on "callback", this is the only part of the...
Read more >Callback must be a function Received undefined - YouTube
Join this channel to get access to perks:https://www.youtube.com/channel/UCoSpmr2KNOxjwE_B9ynUmig/joinMy GearCamera ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed by #251
@ibc: a debug run revealed the following and a fix:
WebSocketConnection.handleSocketData
calls the object’ssetKeepaliveTimerHandler
which references the object’s_keepaliveTimerHandler
property as thesetTimeout
functionWebSocketConnection
constructor function creates the referenced property only in the case where thekeepalive
anduseNativeKeepalive
configuration members are set totrue' and
falserespectively, the
setTimeout` function argument is the undefined.I got rid of the exception by moving the
_keepaliveTimerHandler
property definition out of the conditional statement (to right after the_closeTimerHandler
property definition).Cheers