TwilioDevEd / api-snippets

Code snippets for the Twilio API Documentation
MIT License
260 stars 469 forks source link

TypeError: source.on is not a function when creating video composition. #651

Closed Nikola-Andreev closed 6 years ago

Nikola-Andreev commented 6 years ago

The following example doesn't work for me. https://github.com/TwilioDevEd/api-snippets/blob/master/video/rest/compositions/compose-room/compose-room.3.x.js

Here is the error i receive:

(node:8308) UnhandledPromiseRejectionWarning: TypeError: source.on is not a function
    at Function.DelayedStream.create (...\node_modules\delayed-stream\lib\delayed_stream.js:33:10)
    at FormData.CombinedStream.append (...\node_modules\combined-stream\lib\combined_stream.js:44:37)
    at FormData.append (...\node_modules\form-data\lib\form_data.js:74:3)
    at appendFormValue (...\node_modules\twilio\node_modules\request\request.js:323:21)
    at Request.init (...\node_modules\twilio\node_modules\request\request.js:334:11)
    at new Request (...\node_modules\twilio\node_modules\request\request.js:128:8)
    at request (...\node_modules\twilio\node_modules\request\index.js:53:10)
    at RequestClient.request (...\node_modules\twilio\lib\base\RequestClient.js:73:3)
    at Twilio.request (...\node_modules\twilio\lib\rest\Twilio.js:216:26)
    at Video.Domain.request (...\node_modules\twilio\lib\base\Domain.js:34:22)

Any suggestions?

Nikola-Andreev commented 6 years ago

Of course i forgot to update the twillio version. npm install twilio --save and everything is fine :)