Skip to content

Obscure circular JSON error #149

@dkundel

Description

@dkundel

While developing new function template I found an obscure bug.

This code works:

exports.handler = function(context, event, callback) {
  let twiml = new Twilio.twiml.MessagingResponse();
  twiml.message('Hello World');
  callback(null, twiml);
};

But if you import Twilio explicitly:

const Twilio = require('twilio');

exports.handler = function(context, event, callback) {
  let twiml = new Twilio.twiml.MessagingResponse();
  twiml.message('Hello World');
  callback(null, twiml);
};

It will throw an error on the callback line that it failed to convert a circular JSON.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions