From 98dd11b3642495daa859e11a6b51a2d0e898cb72 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 20 Sep 2022 10:24:53 +0100 Subject: [PATCH] fix(nuxt): only observe elements, not comments or text nodes --- 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 7407f30f11e..baab6d0b9cb 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