mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(nuxt): don't warn when data fetching in middleware (#28604)
This commit is contained in:
parent
dba2b972bd
commit
2fcadda2e5
@ -363,7 +363,7 @@ export function useAsyncData<
|
||||
if (import.meta.client) {
|
||||
// Setup hook callbacks once per instance
|
||||
const instance = getCurrentInstance()
|
||||
if (import.meta.dev && !nuxtApp.isHydrating && (!instance || instance?.isMounted)) {
|
||||
if (import.meta.dev && !nuxtApp.isHydrating && !nuxtApp._processingMiddleware /* internal flag */ && (!instance || instance?.isMounted)) {
|
||||
// @ts-expect-error private property
|
||||
console.warn(`[nuxt] [${options._functionName || 'useAsyncData'}] Component is already mounted, please use $fetch instead. See https://nuxt.com/docs/getting-started/data-fetching`)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user