mirror of
https://github.com/nuxt/nuxt.git
synced 2025-03-19 16:01:24 +00:00
fix(nuxt): pass useFetch
function name on server for warning (#31213)
Co-authored-by: "solovev.an" <andrey.solovyov.ccs@gmail.com>
This commit is contained in:
parent
b29c0e86ba
commit
bf454cb5bc
@ -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'
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user