Skip to content

Commit 8ea9e6c

Browse files
MichaelDeBoeyAlan Shaw
and
Alan Shaw
authored
fix(fetch): bind fetch to Window object (#45)
* fix: fetch called on non Window object (web-std#65) ``` TypeError: 'fetch' called on an object that does not implement interface Window. ``` * chore: add changeset --------- Co-authored-by: Alan Shaw <[email protected]>
1 parent 48e09a6 commit 8ea9e6c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.changeset/odd-shoes-add.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@remix-run/web-fetch": patch
3+
---
4+
5+
fetch called on non Window object

packages/fetch/src/lib.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
2-
31
// On the web we just export native fetch implementation
42
export { ReadableStream, Blob, FormData } from './package.js';
53
export const { Headers, Request, Response } = globalThis;
6-
export default globalThis.fetch
7-
4+
export default globalThis.fetch.bind(globalThis)

0 commit comments

Comments
 (0)