我正在尝试发送一封简单的电子邮件(在本地,所以我的环境变量没有设置),我得到:Error: Meteor code must always run within a Fiber. Try wrapping callbacks that you pass to non-Meteor libraries with Meteor.bindEnvironment.
这是我的代码
Meteor.methods({
sendInviteEmail: function(emails) {
console.log("[sendInviteEmails], ", emails);
if (emails !== void 0) {
console.log("[sendInviteEmails] calling meteor method: sendEmail");
return Meteor.call("sendEmail", emails, "email@gmail.com", "test", "test");
}
},
sendEmail: function(to, from, subject, text) {
this.unblock();
Email.send({
to: to,
from: from,
subject: subject,
text: text,
});
},
});
我正在从客户端调用 sendInviteEmail (将在服务器上检查它的有效性)并将该数据传递给 sendEmail (这就是我目前有一些冗余的原因)。我的代码基本上来自 docs.meteor.com,所以我想知道为什么这会出现光纤问题。
非常感谢