When you use a generic parameter (e.g. the T in <T>(...)) to type the returned data of useFetch or useAsyncData, the functions end up inferring the returned data's type to be something with no fields in it (even if T was guaranteed to have certain fields via extends).
Other functions don't seem to have this problem (e.g. $fetch as demonstrated in the reproduction), so this behavior is unlikely to be caused by TypeScript itself (I think it might have something to do with how the pick option affects the type inference process).
Environment
Reproduction
https://stackblitz.com/edit/github-8k6key?file=composables%2FuseCustomData.ts
Describe the bug
When you use a generic parameter (e.g. the
T
in<T>(...)
) to type the returned data ofuseFetch
oruseAsyncData
, the functions end up inferring the returned data's type to be something with no fields in it (even ifT
was guaranteed to have certain fields viaextends
).Other functions don't seem to have this problem (e.g.
$fetch
as demonstrated in the reproduction), so this behavior is unlikely to be caused by TypeScript itself (I think it might have something to do with how thepick
option affects the type inference process).Additional context
No response
Logs
No response