From 98ce2e6492d7712fcbf49a47f86a3d2dd8adff19 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 20 Sep 2022 10:29:22 +0100 Subject: [PATCH] fix(nuxt): only observe tag elements for `` prefetching (#7679) --- packages/nuxt/src/app/components/nuxt-link.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nuxt/src/app/components/nuxt-link.ts b/packages/nuxt/src/app/components/nuxt-link.ts index 7407f30f11..baab6d0b9c 100644 --- a/packages/nuxt/src/app/components/nuxt-link.ts +++ b/packages/nuxt/src/app/components/nuxt-link.ts @@ -197,7 +197,7 @@ export function defineNuxtLink (options: NuxtLinkOptions) { let unobserve: Function | null = null onMounted(() => { idleId = requestIdleCallback(() => { - if (el?.value) { + if (el?.value?.tagName) { unobserve = observer!.observe(el.value, async () => { unobserve?.() unobserve = null