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.
While developing new function template I found an obscure bug.
This code works:
But if you import
Twilioexplicitly:It will throw an error on the
callbackline that it failed to convert a circular JSON.