Skip to content


Subversion checkout URL

You can clone with
Download ZIP


TypeError: Cannot call method 'apply' of undefined in now/lib/user.js #171

mikl opened this Issue · 3 comments

3 participants


I encountered this traceback in our logs today, just after a restart of the Now.js server. The remarkable part is that the traceback is entirely between Now.js and, i.e., it would seem that our own code is not the cause:

[TypeError: Cannot call method 'apply' of undefined]
TypeError: Cannot call method 'apply' of undefined
  at Socket.rfcHandler (/srv/www/drupal7/profiles/lektier/spravka/node_modules/now/lib/user.js:101:19)
  at Socket.$emit (events.js:67:17)
  at SocketNamespace.handlePacket (/srv/www/drupal7/profiles/lektier/spravka/node_modules/now/node_modules/
  at Manager.onClientMessage (/srv/www/drupal7/profiles/lektier/spravka/node_modules/now/node_modules/
  at WebSocket.onMessage (/srv/www/drupal7/profiles/lektier/spravka/node_modules/now/node_modules/
  at Parser.<anonymous> (/srv/www/drupal7/profiles/lektier/spravka/node_modules/now/node_modules/
  at Parser.emit (events.js:67:17)
  at /srv/www/drupal7/profiles/lektier/spravka/node_modules/now/node_modules/
  at Parser.expectHandler (/srv/www/drupal7/profiles/lektier/spravka/node_modules/now/node_modules/
  at Parser.add (/srv/www/drupal7/profiles/lektier/spravka/node_modules/now/node_modules/

It also occurred later without a restart of the server, so there's something strange going on. It could ostensibly be worked around by checking theFunction before call()'ing it.

These are the versions I'm using:

├─┬ now@0.7.6 
│ ├── node-proxy@0.5.2 
│ └─┬ 
│   ├── policyfile@0.0.4 
│   ├── redis@0.6.7 
│   └─┬ 
│     ├── uglify-js@1.0.6 
│     ├── websocket-client@1.0.0 
│     └── xmlhttprequest@1.2.2 

True. this error may occur when you emit a remote function call on a fqn whose function is undefined. please check the branch removegroup(./lib/user.js) from line 110. Is it what you suggested?


This still doesn't resolve the fundamental issue: why are remote function calls being requested for undefined functions? I imagine no manual injections are at work, so an initial guess would be a closure call. If you can figure out how to replicate the error, I'd appreciate it if you could turn up log level to 3 and provide some more detailed output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.