WebClient files.upload 失败,无法读取未定义的 属性 'name'

WebClient files.upload fails with cannot read property 'name' of undefined

在我的服务器上尝试使用 files.upload API 上传文件时,当我正在上传的文件被转换为多部分表单数据时遇到以下错误:

TypeError: Cannot read property 'name' of undefined 
    at FormData._getContentDisposition (/app/node_modules/form-data/lib/form_data.js:226:40) 
    at FormData._multiPartHeader (/app/node_modules/form-data/lib/form_data.js:177:33) 
    at FormData.append (/app/node_modules/form-data/lib/form_data.js:70:21) 
    at flattened.reduce (/app/node_modules/@slack/client/dist/WebClient.js:459:26) 
    at Array.reduce (<anonymous>) 
    at WebClient.serializeApiCallOptions (/app/node_modules/@slack/client/dist/WebClient.js:438:30) 
    at WebClient.<anonymous> (/app/node_modules/@slack/client/dist/WebClient.js:342:38) 
    at Generator.next (<anonymous>) 
    at /app/node_modules/@slack/client/dist/WebClient.js:7:71
    at new Promise (<anonymous>)

它在本地对我有用,但在我的服务器上,相同的代码给出了上述响应。有谁知道是什么原因造成的?

如果初始化 WebClient 的令牌是 undefined,则会出现此看似无关的错误消息。

我已经提出 an issue in Slack's Github 来跟踪这个。