From 756566100421801ff2156b7fa900b31b932cb731 Mon Sep 17 00:00:00 2001 From: Enkel Media Date: Tue, 26 Jan 2021 12:57:26 +0100 Subject: [PATCH] Issue #485 Update browser.js to not throw with SSR This updates that browser.js does not throw when rendering on the server and window is not defined. Solves issue #485 --- lib/browser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/browser.js b/lib/browser.js index 09e7c70..0f2c8e4 100644 --- a/lib/browser.js +++ b/lib/browser.js @@ -1,2 +1,2 @@ /* eslint-env browser */ -module.exports = typeof self == 'object' ? self.FormData : window.FormData; +module.exports = typeof self == 'object' ? self.FormData : typeof window !='undefined' ? window.FormData : undefined;