From 20e7b99eb63916c29c503cff38702619f2776e8c Mon Sep 17 00:00:00 2001 From: Payel Karmakar <50908900+PayelKarmakar06@users.noreply.github.com> Date: Wed, 11 Aug 2021 20:02:35 +0530 Subject: [PATCH] fix(vue-app): `null` check for `$root` access (#9150) Co-authored-by: Payel --- packages/vue-app/template/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vue-app/template/index.js b/packages/vue-app/template/index.js index 11d4821d26..06fb94f5c5 100644 --- a/packages/vue-app/template/index.js +++ b/packages/vue-app/template/index.js @@ -46,7 +46,7 @@ Vue.component(Nuxt.name, Nuxt) Object.defineProperty(Vue.prototype, '<%= globals.nuxt %>', { get() { - const globalNuxt = this.$root.$options.<%= globals.nuxt %> + const globalNuxt = this.$root ? this.$root.$options.<%= globals.nuxt %> : null if (process.client && !globalNuxt && typeof window !== 'undefined') { return window.<%= globals.nuxt %> }