You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constresponse=awaitctx.curl('xxx',{ data });response.res.statusMessage;
抛错:
Property 'statusMessage' does not exist on type '(IncomingMessage & { timing?: { queuing: number; dnslookup: number; connected: number; requestSent: number; waiting: number; contentDownload: number; } | undefined; }) | RawResponseWithMeta'.
Property 'statusMessage' does not exist on type 'RawResponseWithMeta'.
当前 curl API 返回值的类型是 Promise<HttpClientResponseOld<T> | HttpClientResponse<T>>,
Enter your suggestions in details:
遇到的问题:
项目使用的EggJS从V2升级到了V3,遇到一些代码报错:
抛错:
当前 curl API 返回值的类型是
Promise<HttpClientResponseOld<T> | HttpClientResponse<T>>
,运行时具体返回的值看起来应该是取决于
config.httpclient.useHttpClientNext
是否开启。egg/lib/egg.js
Lines 294 to 305 in 9957b9c
对我当前的项目来说,我没有使用
useHttpClientNext
,所以实际返回值一直都是HttpClientResponseOld
,但我确实不能直接使用这个类型上和HttpClientResponse
不兼容的属性,还是有些困惑的。目前还没找到相关的文档。
The text was updated successfully, but these errors were encountered: