Skip to content

Commit

Permalink
Null check for $root
Browse files Browse the repository at this point in the history
  • Loading branch information
PayelKarmakarNG committed Apr 14, 2021
1 parent 9212d34 commit 6ec515c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vue-app/template/index.js
Expand Up @@ -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 %>
}
Expand Down

0 comments on commit 6ec515c

Please sign in to comment.