&引用;迭代器不提供';投掷';方法。”;在Foreach node.js中
我在使用nodejs生成器时遇到问题,当我启动代码时,出现以下错误:&引用;迭代器不提供';投掷';方法。”;在Foreach node.js中,node.js,generator,unhandled-exception,adonis.js,Node.js,Generator,Unhandled Exception,Adonis.js,我在使用nodejs生成器时遇到问题,当我启动代码时,出现以下错误: node:3632) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: The iterator does not provide a 'throw' method. (node:3632) [DEP0018] DeprecationWarning: Unhandled promise reje
node:3632) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: The iterator does not provide a 'throw' method.
(node:3632) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
代码如下,我使用AdoniJs。User.all和User.typeModule都是数据库关系
// This is the function that is called at the defined schedule
* handle () {
const usersWrapper = yield User.all()
yield * usersWrapper.map(function * (user) {
const typeModulesWrapper = yield user.typeModule()
typeModulesWrapper.map(function (module) {
const Controller = use(module.controller_path)
Controller.event()
})
})
}
}
多谢各位