From 22f540f86193ede5b115813e1fd2d2ea21ff93cf 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 42bc000dd3..7aa3a6c994 100644 --- a/packages/nuxt/src/app/composables/fetch.ts +++ b/packages/nuxt/src/app/composables/fetch.ts @@ -144,7 +144,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' } @@ -227,7 +227,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' }