jesse21
jesse21
  • 发布:2024-04-23 12:57
  • 更新:2024-07-08 14:14
  • 阅读:240

最新版本HbuilderX-Alpha和最新版本微信开发者工具,云函数调用 await uniCloud.httpclient.request报错

分类:HBuilderX

云函数里,本地调试。这样调用报错,

const res2112 = await uniCloud.httpclient.request(paraUrl, {
method: 'POST',

12:53:18.635 [本地调试]Error: read ECONNRESET
12:53:18.635 [本地调试] at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20)

Error: read ECONNRESET, POST https://api.sunoaiapi.com/api/v1/gateway/generate/gpt_desc -1 (connected: true, keepalive socket: false, socketHandledRequests: 1, socketHandledResponses: 0)
headers: {}
at _construct (construct.js?b17c:4)
at new Wrapper (wrapNativeSuper.js?a128:17)
at te._createSuperInternal (index.js?a9ff:1)
at new te (index.js?a9ff:1)
at success (index.js?a9ff:1)
at Object.<anonymous> (WASubContext.js?t=wechat&s=1713847970445&v=3.4.0:1)
at Object.<anonymous> (WASubContext.js?t=wechat&s=1713847970445&v=3.4.0:1)
at WAServiceMainContext.js?t=wechat&s=1713847970445&v=3.4.0:1
at Module.Dn (WASubContext.js?t=wechat&s=1713847970445&v=3.4.0:1)
at Object.success (WAServiceMainContext.js?t=wechat&s=1713847970445&v=3.4.0:1)

之前都没问题,代码没动,今天才出现这个问题

2024-04-23 12:57 负责人:无 分享
已邀请:
DCloud_uniCloud_WYQ

DCloud_uniCloud_WYQ

看错误信息是请求三方服务报错,可以试一下用postman之类的工具能不能请求通

  • jesse21 (作者)

    能通,换了好几个第三方api都报这个错,本地调试时候才会出现,云端调试没问题。 今天刚更新最新版本hbuilder的al

    pha版本也是这样

    2024-07-04 22:42

jesse21

jesse21 (作者)

22:58:47.876 [本地调试]event : {"method":"aiVideo","params":Object,"uniIdToken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiI2N…jczfQ.8l2jrwKpdFgmdrOvjRLCKN_auwXjYXzwfPWR_r_TYCc"} uniCloud-aliyun/cloudfunctions/yun-fun-new/index.js:4:9
22:58:47.877 [本地调试]我看看claude3的请求总参数 {"user_prompt":"一个猫在跳跃到台阶上","aspect_ratio":"16:9","expand_prompt":true} uniCloud-aliyun/cloudfunctions/yun-fun-new/index.js:32:11

22:58:48.051 [本地调试]Error: read ECONNRESET
22:58:48.051 [本地调试] at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20)

今日,Hbuilder和微信小程序版本,都是最新版本,依然这个报错,

jesse21

jesse21 (作者)

使用iOS 自定义基座调试和小程序调试,都报这个错误,,,,

DCloud_uniCloud_WYQ

DCloud_uniCloud_WYQ

贴一下完整的代码,还有对应的能请求通的postman截图

  • jesse21 (作者)

    已发你qq

    2024-07-11 16:42

要回复问题请先登录注册