diff --git a/packages/nuxt/src/app/composables/fetch.ts b/packages/nuxt/src/app/composables/fetch.ts index 0ff307c23..2d52a096e 100644 --- a/packages/nuxt/src/app/composables/fetch.ts +++ b/packages/nuxt/src/app/composables/fetch.ts @@ -26,8 +26,8 @@ export function useFetch< request: Ref | ReqT | (() => ReqT), opts: UseFetchOptions<_ResT, Transform, PickKeys> = {} ) { - if (process.dev && opts.transform && !opts.key) { - console.warn('[nuxt] You should provide a key for `useFetch` when using a custom transform function.') + if (process.dev && !opts.key && Object.values(opts).some(v => typeof v === 'function' || v instanceof Blob)) { + console.warn('[nuxt] [useFetch] You should provide a key when passing options that are not serializable to JSON:', opts) } const key = '$f_' + (opts.key || hash([request, { ...opts, transform: null }])) const _request = computed(() => {