We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 87aeaea commit fe77e7aCopy full SHA for fe77e7a
src/index.ts
@@ -9,6 +9,18 @@ import _fetch, {
9
10
import _AbortController from 'abort-controller'
11
12
+// Hotfix for https://github.com/unjs/node-fetch-native/issues/10
13
+const isStackblitz = process.env.SHELL === '/bin/jsh'
14
+if (isStackblitz && !globalThis.fetch) {
15
+ // @ts-ignore
16
+ globalThis.fetch = (url: any, opts: any) => {
17
+ if (typeof url === 'string' && url.includes('//[::]')) {
18
+ url = url.replace('//[::]', '//0.0.0.0')
19
+ }
20
+ return fetch(url, opts)
21
22
+}
23
+
24
export const fetch = globalThis.fetch || _fetch
25
export default fetch
26
0 commit comments