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

[botbuilder-adapter-web] TypeError: cb is not a function #2003

Closed
dominik1001 opened this issue Jul 22, 2020 · 1 comment · Fixed by #2022
Closed

[botbuilder-adapter-web] TypeError: cb is not a function #2003

dominik1001 opened this issue Jul 22, 2020 · 1 comment · Fixed by #2022

Comments

@dominik1001
Copy link

dominik1001 commented Jul 22, 2020

Are you sure this is an issue with the Botkit core module?

Yes (botbuilder-adapter-web)

What are you trying to achieve or the steps to reproduce?

Keeping a WebSocket running.

What was the result you received?

The above error, with the following stack trace:

TypeError: cb is not a function
1
at sendAfterClose (/app/packages/api/node_modules/ws/lib/websocket.js line 733 col 4)
cb(err);
2
at WebSocket.ping (/app/packages/api/node_modules/ws/lib/websocket.js line 273 col 6)
sendAfterClose(this, data, cb);
3
at each (/app/packages/api/node_modules/botbuilder-adapter-web/lib/web_adapter.js line 144 col 19)
ws.ping('', false, true);
4
at Set.forEach (<anonymous> line (unknown))
5
at Timeout._onTimeout (/app/packages/api/node_modules/botbuilder-adapter-web/lib/web_adapter.js line 139 col 29)
this.wss.clients.forEach(function each(ws) {
6
at listOnTimeout (internal/timers.js line 549 col 16)
7
at processTimers (internal/timers.js line 492 col 6)

https://github.com/websockets/ws/blob/da42ea17451f11eed54adb54d3beeedbb1c2aa70/lib/websocket.js#L270

https://github.com/websockets/ws/blob/da42ea17451f11eed54adb54d3beeedbb1c2aa70/lib/websocket.js#L730

What did you expect?

No Error

Screenshots and animated GIFs

Context:

  • Botkit version: 4.9.0
  • Messaging Platform: Web
  • Node version: v12.18.2
  • Os: Ubuntu 18.04.4 LTS
  • Any other relevant information:

Analysis

IMO the call

ws.ping('', false, true);

is faulty since the third argument should be a function.

@benbrown
Copy link
Contributor

This will be fixed in the next release. Thanks for helping! Sorry for the long wait.

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

Successfully merging a pull request may close this issue.

2 participants