From 553fe689ee1910892238f15407fc70b0dca00693 Mon Sep 17 00:00:00 2001 From: Thomas Hallock Date: Wed, 14 Nov 2018 22:08:56 -0800 Subject: [PATCH] not failing in module scope when run in node --- src/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/index.js b/src/index.js index c8387135..d58e3334 100644 --- a/src/index.js +++ b/src/index.js @@ -2,6 +2,9 @@ import { create } from './create' import { run } from './run' const createWrapper = () => { + if ('undefined' === typeof window) { + return null; + } if (!window.Worker) { console.error('This browser does not support Workers.') return null