From f1511ac566588adef7558dd02219688d860d6d35 Mon Sep 17 00:00:00 2001 From: Seth Fitzsimmons Date: Wed, 26 Jun 2019 11:59:02 -0700 Subject: [PATCH] fix: ensure hasAttribute exists on $root.$el If ...$el is a comment node (which appears to happen during initialization under some circumstances), it will be truthy but won't have `hasAttribute`. --- src/shared/mixin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/mixin.js b/src/shared/mixin.js index 8ec2344..296738c 100644 --- a/src/shared/mixin.js +++ b/src/shared/mixin.js @@ -79,7 +79,7 @@ export default function createMixin(Vue, options) { ensuredPush(this.$options, 'beforeMount', () => { // if this Vue-app was server rendered, set the appId to 'ssr' // only one SSR app per page is supported - if (this.$root.$el && this.$root.$el.hasAttribute('data-server-rendered')) { + if (this.$root.$el && this.$root.$el.hasAttribute && this.$root.$el.hasAttribute('data-server-rendered')) { this.$root._vueMeta.appId = 'ssr' } })