首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >微搭自定义链接器报Cannot read property 'then' of undefined?

微搭自定义链接器报Cannot read property 'then' of undefined?

提问于 2022-08-20 22:25:05
回答 0关注 0查看 46

在微搭自定义链接器中,选择 自定义代码,把官方录音文件识别结果查询的餐卡代码放进去,点击测试时报错,Cannot read property 'then' of undefined ,谁知道是什么原因么?

方法代码:

代码语言:js
复制
// Depends on tencentcloud-sdk-nodejs version 4.0.3 or higher
const tencentcloud = require("tencentcloud-sdk-nodejs");

const AsrClient = tencentcloud.asr.v20190614.Client;

// 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey,此处还需注意密钥对的保密
// 密钥可前往https://console.cloud.tencent.com/cam/capi网站进行获取
const clientConfig = {
  credential: {
    secretId: "SecretId",
    secretKey: "SecretKey",
  },
  region: "",
  profile: {
    httpProfile: {
      endpoint: "asr.tencentcloudapi.com",
    },
  },
};

// 实例化要请求产品的client对象,clientProfile是可选的
const client = new AsrClient(clientConfig);
const params = {};
client.DescribeTaskStatus(params).then(
  (data) => {
    console.log(data);
  },
  (err) => {
    console.error("error", err);
  }
);

回答

和开发者交流更多问题细节吧,去 写回答
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档