From 3bba4c6a7fd086aaa434e0abf92bdc9480fd3f4e Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 8 Jan 2021 18:23:55 +0000 Subject: [PATCH] fix(vue-app): check that `link.__prefetch` exists before calling it (#8608) closes #8173 --- packages/vue-app/template/components/nuxt-link.client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vue-app/template/components/nuxt-link.client.js b/packages/vue-app/template/components/nuxt-link.client.js index eac8749590..9dd669023d 100644 --- a/packages/vue-app/template/components/nuxt-link.client.js +++ b/packages/vue-app/template/components/nuxt-link.client.js @@ -17,7 +17,7 @@ const cancelIdleCallback = window.cancelIdleCallback || function (id) { const observer = window.IntersectionObserver && new window.IntersectionObserver((entries) => { entries.forEach(({ intersectionRatio, target: link }) => { - if (intersectionRatio <= 0) { + if (intersectionRatio <= 0 || !link.__prefetch) { return } link.__prefetch()