From 7644edc265d17744ca17d859159abb136dba7229 Mon Sep 17 00:00:00 2001 From: Todd Kennedy Date: Tue, 26 Sep 2017 11:22:17 -0700 Subject: [PATCH] Don't add transformations when server rendering (#17) They don't work without a DOM! --- error-el.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/error-el.js b/error-el.js index 8d5c057..75f940e 100644 --- a/error-el.js +++ b/error-el.js @@ -12,12 +12,14 @@ function ErrorEl (opts) { } ErrorEl.prototype._addTransition = function addTransition (transitionData) { - const keys = Object.keys(transitionData) - for (let i = 0, len = keys.length; i < len; i++) { - const key = keys[i] - const td = transitionData[key] - const val = typeof td === 'function' ? td.call(this) : td - this.$el.style[key] = val + if (typeof window !== 'undefined') { + const keys = Object.keys(transitionData) + for (let i = 0, len = keys.length; i < len; i++) { + const key = keys[i] + const td = transitionData[key] + const val = typeof td === 'function' ? td.call(this) : td + this.$el.style[key] = val + } } }