【发布时间】:2017-10-03 08:10:50
【问题描述】:
我通过一些非常简单的代码得到了“Meteor 代码必须始终在 Fiber 中运行”。
const notif = async (userId, notifs) => {
try {
console.log('Notif Function Start');
const template = await Assets.getText('email-new-appointment-client.html');
return 'sent';
} catch (error) {
throw new Meteor.Error(500, 'notif functions', error);
}
};
notif 是从 Meteor 方法中调用的函数。不涉及回调,不涉及第三方承诺库。
即使在同一个函数中运行以下命令也会导致光纤错误:
Email.send({
to: uEmail,
from: 'fake@email.com',
subject: notifs.title,
html: notifs.body,
});
【问题讨论】:
标签: asynchronous meteor