opentok/opentok-node

2.17.0 breaks due to SyntaxError, automatic json parsing in needle

Closed this issue · 2 comments

2.17.0 breaks when using listStreams and probably listBroadcasts and stopBroadcast as well,, we have gone back to 2.16.0 in the meantime.

It seems to be related to the switch from request to needle as needle automatically parses json unless options.parse is set to false and as far is I can see it is not set at the moment in version 2.17.0, which leads to JSON.parse() throwing errors. You could either set parse:false on the specific request or simply change the defaults for all request by setting parse_response: false: on the defaults. Read more here: https://github.com/tomas/needle/#overriding-defaults

Another option could be to simply remove the JSON.parse() in the requestCallbacks.

I created a ticket to Vonage about this.

This has been resolved