Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

Commit

Permalink
fix for whatwg-fetch@3.0.0 issue in node
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonlesisz committed Jul 31, 2019
1 parent c57cf3e commit a7d8833
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/index.js
Expand Up @@ -9,7 +9,13 @@ import LowlevelTransportWithSharedConnections from './lowlevel/withSharedConnect
import FallbackTransport from './fallback';
import WebUsbPlugin from './lowlevel/webusb';

import 'whatwg-fetch';
// node throw error with version 3.0.0
// https://github.com/github/fetch/issues/657
try {
require(`whatwg-fetch`);
} catch (e) {
// empty
}

if (typeof window === `undefined`) {
// eslint-disable-next-line quotes
Expand Down

0 comments on commit a7d8833

Please sign in to comment.