From bf454cb5bc571f17ae5fd52acf94fa9a1a1fcd4d Mon Sep 17 00:00:00 2001 From: John Tanzer <82201261+moshetanzer@users.noreply.github.com> Date: Fri, 7 Mar 2025 13:12:26 +0200 Subject: [PATCH] fix(nuxt): pass `useFetch` function name on server for warning (#31213) Co-authored-by: "solovev.an" --- packages/nuxt/src/app/composables/fetch.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nuxt/src/app/composables/fetch.ts b/packages/nuxt/src/app/composables/fetch.ts index 57e2b0b813..e5ef2f6db6 100644 --- a/packages/nuxt/src/app/composables/fetch.ts +++ b/packages/nuxt/src/app/composables/fetch.ts @@ -147,7 +147,7 @@ export function useFetch< watch: watch === false ? [] : [_fetchOptions, _request, ...(watch || [])], } - if (import.meta.dev && import.meta.client) { + if (import.meta.dev && import.meta.server) { // @ts-expect-error private property _asyncDataOptions._functionName = opts._functionName || 'useFetch' } @@ -230,7 +230,7 @@ export function useLazyFetch< ) { const [opts = {}, autoKey] = typeof arg1 === 'string' ? [{}, arg1] : [arg1, arg2] - if (import.meta.dev && import.meta.client) { + if (import.meta.dev && import.meta.server) { // @ts-expect-error private property opts._functionName ||= 'useLazyFetch' }