这个是腾讯云 云函数中发现的问题。
tencentcloud-sdk-nodejs
直接放在函数中没有问题,但将依赖使用层管理后 会报错,所以 tencentcloud-sdk-nodejs 我仍然只能直接放在云函数中后正常使用。报错信息如下:
UnhandledPromiseRejectionWarning: TypeError: cb is not a function
at TcbClient.failRequest (/var/lang/node12/lib/node_modules/tencentcloud-sdk-nodejs/tencentcloud/common/abstract_client.js:65:9)
at /var/lang/node12/lib/node_modules/tencentcloud-sdk-nodejs/tencentcloud/common/abstract_client.js:72:98
at processTicksAndRejections (internal/process/task_queues.js:97:5)
UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode).