We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6510a27 commit 328c312Copy full SHA for 328c312
packages/react-app-polyfill/jsdom.js
@@ -6,5 +6,9 @@
6
*/
7
'use strict';
8
9
-// fetch() polyfill for making API calls.
10
-require('whatwg-fetch');
+// Make sure we're in a Browser-like environment before importing polyfills
+// This prevents `fetch()` from being imported in a Node test environment
11
+if (typeof window !== 'undefined') {
12
+ // fetch() polyfill for making API calls.
13
+ require('whatwg-fetch');
14
+}
0 commit comments