Skip to content

Commit

Permalink
fix: ensure hasAttribute exists on $root.$el
Browse files Browse the repository at this point in the history
If ...$el is a comment node (which appears to happen during initialization under some circumstances), it will be truthy but won't have `hasAttribute`.
  • Loading branch information
mojodna authored and pimlie committed Jun 26, 2019
1 parent 877f765 commit f1511ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shared/mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
})
Expand Down

0 comments on commit f1511ac

Please sign in to comment.