You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when trying to send email by sendgrid the lambda does not show log and ends up giving timeout. I've tried putting it inside a promise, but it didn't help. The initial handler has already been placed asyncronously. The same error also happens when I try to upload on S3. This problem only happens when it is deployed on aws, on serverless-offline it works correctly.
handler.js
import app from './';
import serverless from 'serverless-http';
const handler = serverless(app);
module.exports.handler = async (event, context) => {
// you can do other things here
const result = await new Promise(async (resolve, reject) => {
const resProm = await handler(event, context);
resolve(resProm);
});
// and here
return result;
};
const result = await new Promise(async (resolve, reject) => {
const resProm = await handler(event, context);
resolve(resProm);
});
This is risky, the Promise constructor does not, as far as I know, respect rejected promises and will therefore never settle. It's posisble you have an unhandled rejection being swallowed; you should at least do:
when trying to send email by sendgrid the lambda does not show log and ends up giving timeout. I've tried putting it inside a promise, but it didn't help. The initial handler has already been placed asyncronously. The same error also happens when I try to upload on S3. This problem only happens when it is deployed on aws, on serverless-offline it works correctly.
handler.js
serveless.yml
sendMail.js
The text was updated successfully, but these errors were encountered: