Skip to content

hour13 example04 running error with callback function undefined #2

Description

@changyh

Hi George,

I got the following error on the hour13 example 4 of your book, I put it as the following, who define the callback function?

Thanks,
Y.H. Chang

C:\1yh\download\bk\JavaScript\node_js_Redis\tysf_nodejs\hour13\example04>node ap
p.js
info - socket.io started
debug - served static content /socket.io.js
debug - client authorized
info - handshake authorized 18904434431555541341
debug - setting request GET /socket.io/1/websocket/18904434431555541341
debug - set heartbeat interval for client 18904434431555541341
debug - client authorized for
debug - websocket writing 1::

C:\1yh\download\bk\JavaScript\node_js_Redis\tysf_nodejs\hour13\example04\app.js:
16
callback(true);
^
TypeError: undefined is not a function
at Socket. (C:\1yh\download\bk\JavaScript\node_js_Redis\tysf_node
js\hour13\example04\app.js:16:7)
at Socket.EventEmitter.emit as $emit
at SocketNamespace.handlePacket (C:\1yh\download\bk\JavaScript\node_js_Redis
\tysf_nodejs\hour13\example04\node_modules\socket.io\lib\namespace.js:335:22)
at Manager.onClientMessage (C:\1yh\download\bk\JavaScript\node_js_Redis\tysf
_nodejs\hour13\example04\node_modules\socket.io\lib\manager.js:459:38)
at WebSocket.Transport.onMessage (C:\1yh\download\bk\JavaScript\node_js_Redi
s\tysf_nodejs\hour13\example04\node_modules\socket.io\lib\transport.js:387:20)
at Parser. (C:\1yh\download\bk\JavaScript\node_js_Redis\tysf_node
js\hour13\example04\node_modules\socket.io\lib\transports\websocket\hybi-16.js:4
0:10)
at Parser.EventEmitter.emit (events.js:93:17)
at opcodeHandlers.1.finish (C:\1yh\download\bk\JavaScript\node_js_Redis\tysf
_nodejs\hour13\example04\node_modules\socket.io\lib\transports\websocket\hybi-16
.js:286:16)
at Parser.opcodeHandlers.1.expectData [as expectHandler](C:1yhdownloadbk
JavaScriptnode_js_Redistysf_nodejshour13example04node_modulessocket.ioli
btransportswebsockethybi-16.js:297:15)
at Parser.add (C:\1yh\download\bk\JavaScript\node_js_Redis\tysf_nodejs\hour1
3\example04\node_modules\socket.io\lib\transports\websocket\hybi-16.js:464:24)

C:\1yh\download\bk\JavaScript\node_js_Redis\tysf_nodejs\hour13\example04>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions