javascript - 使用 BlueBird.Promisify 时,未捕获的 typeError 中间值不是函数

标签 javascript node.js bluebird

我尝试 Promisify elasticsearch.client.index,然后我得到了 未捕获的类型错误中间值不是函数 在 makeNodePromissifedEval

我使用的是blubebird 3.5.0 Nodejs 8.1.2

最佳答案

当您不使用分号时,有时会发生此错误。

由于您没有包含代码,因此无法判断情况是否如此,但当人们询问此错误时,95% 的人都缺少分号。

示例:

// missing semicolons:
const x = 10
(x => console.log(x))(20)
// TypeError: 10 is not a function

// semicolons present:
const x = 10;
(x => console.log(x))(20);
// works fine

关于javascript - 使用 BlueBird.Promisify 时,未捕获的 typeError 中间值不是函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45145945/

相关文章:

javascript - three.js 字体中的重复点

javascript - Mozilla Persona/BrowserID 电子邮件地址和 cookie

javascript - Angularjs:在 ng-repeat 中过滤多个条件

javascript - 尝试使用 consign 连接 mysql 和 Node js 时出现未定义问题

javascript - 设置 bluebird.js promise 解析的最小延迟

javascript - bluebird 如何知道继续处理该链中的下一个 `then`?

javascript - 淡入 JavaScript innerHTML

javascript - 语法错误 : Unexpected token at acorn. js

node.js - 使用 AWS Lambda NodeJS 时无法返回结果

javascript - Bluebird Promise.map 无法正常工作