From ca4a963e93fe5efcdf84cda0dbe571d293f079a5 Mon Sep 17 00:00:00 2001 From: Bayan Bennett Date: Sat, 22 Aug 2020 15:29:28 +0300 Subject: [PATCH] fix: SSR compatibility (#284) --- src/runtime/inline.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/runtime/inline.js b/src/runtime/inline.js index f702753..0372f08 100644 --- a/src/runtime/inline.js +++ b/src/runtime/inline.js @@ -1,8 +1,6 @@ /* eslint-env browser */ /* eslint-disable no-undef, no-use-before-define, new-cap */ -const URL = window.URL || window.webkitURL; - module.exports = (content, workerConstructor, workerOptions, url) => { try { try { @@ -25,7 +23,8 @@ module.exports = (content, workerConstructor, workerOptions, url) => { blob = blob.getBlob(); } - + + const URL = window.URL || window.webkitURL; const objectURL = URL.createObjectURL(blob); const worker = new window[workerConstructor](objectURL, workerOptions);