为什么 sendgrid node.js api 在发送电子邮件时会挂起并且没有给出错误?

Why would the sendgrid node.js api hang when sending an email and give no error?

我正在尝试在重新混合操作中发送带有 sendgrid 的电子邮件。我已验证 api 键是正确的环境变量。根本没有任何内容被记录到控制台。这是我的代码:

const sgMail = require("@sendgrid/mail");
  sgMail.setApiKey(process.env.SENDGRID_KEY);
  const message = {
    from: "admin@chriswestbrook.com",
    to: "westbchris+blog@gmail.com",
    subject: `a comment has been left on ${slug}`,
    text: "testing",
    html: `author:${author}<br/>
    email:${email}<br/>
    text:${text}
    `,
  };
  try {
    await sgMail.send(message);
  } catch (e) {
    console.log(e);
  }

我是不是遗漏了什么明显的东西?

这最终与他们使用 msw 模拟服务器 api 请求阻塞 sendgrid 的 Indy 堆栈有关。看到这个 issue.