Skip to content

TypeError: TwimlResponse is not a constructor #1453

@timburgess

Description

@timburgess

Running the demo server for twilio produces TypeError: TwimlResponse is not a constructor when the /sms/receive path is used.

package.json is specifying "twilio": "^3.30.3"

Handler code is

app.post('/sms/receive', bodyParser, (req, res) => {
  const sender = req.body.From
  const body = req.body.Body

  const resp = new TwimlResponse()
  resp.message(`Hello, ${sender}, you said: ${body}`)

  res
    .status(200)
    .contentType('text/xml')
    .send(resp.toString())
})

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions