Skip to content

Commit bf454cb

Browse files
moshetanzer"solovev.an"
authored andcommitted
fix(nuxt): pass useFetch function name on server for warning (#31213)
Co-authored-by: "solovev.an" <[email protected]>
1 parent b29c0e8 commit bf454cb

File tree

1 file changed

+2
-2
lines changed
  • packages/nuxt/src/app/composables

1 file changed

+2
-2
lines changed

packages/nuxt/src/app/composables/fetch.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export function useFetch<
147147
watch: watch === false ? [] : [_fetchOptions, _request, ...(watch || [])],
148148
}
149149

150-
if (import.meta.dev && import.meta.client) {
150+
if (import.meta.dev && import.meta.server) {
151151
// @ts-expect-error private property
152152
_asyncDataOptions._functionName = opts._functionName || 'useFetch'
153153
}
@@ -230,7 +230,7 @@ export function useLazyFetch<
230230
) {
231231
const [opts = {}, autoKey] = typeof arg1 === 'string' ? [{}, arg1] : [arg1, arg2]
232232

233-
if (import.meta.dev && import.meta.client) {
233+
if (import.meta.dev && import.meta.server) {
234234
// @ts-expect-error private property
235235
opts._functionName ||= 'useLazyFetch'
236236
}

0 commit comments

Comments
 (0)