diff --git a/packages/nuxt/src/app/composables/asyncData.ts b/packages/nuxt/src/app/composables/asyncData.ts index a809ff2f09..59fc441364 100644 --- a/packages/nuxt/src/app/composables/asyncData.ts +++ b/packages/nuxt/src/app/composables/asyncData.ts @@ -62,12 +62,12 @@ export interface AsyncDataOptions< * An `undefined` return value will trigger a fetch. * Default is `key => nuxt.isHydrating ? nuxt.payload.data[key] : nuxt.static.data[key]` which only caches data when payloadExtraction is enabled. */ - getCachedData?: (key: string, nuxtApp: NuxtApp) => NoInfer | undefined + getCachedData?: (key: string, nuxtApp: NuxtApp) => NoInfer | undefined /** * A function that can be used to alter handler function result after resolving. * Do not use it along with the `pick` option. */ - transform?: _Transform + transform?: _Transform /** * Only pick specified keys in this array from the handler function result. * Do not use it along with the `transform` option. @@ -293,7 +293,7 @@ export function useAsyncData< let result = _result as unknown as DataT if (options.transform) { - result = await options.transform(_result) + result = await options.transform(_result as any) } if (options.pick) { result = pick(result as any, options.pick) as DataT