Files
devhub/patches/@octokit/request+2.2.0.patch
Bruno Lemos 764cca4264 Fix random fetch error
Failed to execute 'fetch' on 'Window': Illegal invocation
2018-12-09 03:30:49 -02:00

13 lines
425 B
Diff

patch-package
--- a/node_modules/@octokit/request/lib/fetch.js
+++ b/node_modules/@octokit/request/lib/fetch.js
@@ -1,2 +1,6 @@
-// expose internally used `fetch` method for testing/mocking only
-module.exports.fetch = require('node-fetch').default
+module.exports.fetch =
+ typeof fetch === 'undefined'
+ ? require('node-fetch').default
+ : typeof window !== 'undefined'
+ ? window.fetch.bind(window)
+ : fetch