Skip to content

TypeError: source.on is not a function #452

@fishcharlie

Description

@fishcharlie

When trying to send a message I get an error: TypeError: source.on is not a function.

Version: 3.31.0

Code Snippet

twilio.messages.create({
    "to": "+18009876543", // I changed the phone number for this issue
    "from": "+18001234567", // I changed the phone number for this issue
    "body": "Hello World"
}).then((message) => resolve(message)).catch((error) => reject(error));

Exception/Log

TypeError: source.on is not a function
    at Function.DelayedStream.create (/Users/charliefish/Desktop/MyApp/node_modules/delayed-stream/lib/delayed_stream.js:33:10)
    at FormData.CombinedStream.append (/Users/charliefish/Desktop/MyApp/node_modules/combined-stream/lib/combined_stream.js:44:37)
    at FormData.append (/Users/charliefish/Desktop/MyApp/node_modules/form-data/lib/form_data.js:74:3)
    at appendFormValue (/Users/charliefish/Desktop/MyApp/node_modules/request/request.js:326:21)
    at Request.init (/Users/charliefish/Desktop/MyApp/node_modules/request/request.js:337:11)
    at new Request (/Users/charliefish/Desktop/MyApp/node_modules/request/request.js:127:8)
    at request (/Users/charliefish/Desktop/MyApp/node_modules/request/index.js:53:10)
    at RequestClient.request (/Users/charliefish/Desktop/MyApp/node_modules/twilio/lib/base/RequestClient.js:78:3)
    at Twilio.request (/Users/charliefish/Desktop/MyApp/node_modules/twilio/lib/rest/Twilio.js:241:26)
    at Api.Domain.request (/Users/charliefish/Desktop/MyApp/node_modules/twilio/lib/base/Domain.js:34:22)
    at V2010.Version.request (/Users/charliefish/Desktop/MyApp/node_modules/twilio/lib/base/Version.js:45:23)
    at V2010.Version.create (/Users/charliefish/Desktop/MyApp/node_modules/twilio/lib/base/Version.js:125:24)
    at Function.create (/Users/charliefish/Desktop/MyApp/node_modules/twilio/lib/rest/api/v2010/account/message.js:122:33)
    at Promise (/Users/charliefish/Desktop/MyApp/index.js:283:19)
    at new Promise (<anonymous>)
    at sendSMS (/Users/charliefish/Desktop/MyApp/index.js:270:9)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions