Skip to content

Commit 27fadf9

Browse files
authored
Merge pull request #282 from Portkey-AI/fix/cloudflare-worker-fetch-binding-281
Fix 'Illegal invocation' error in Cloudflare Workers
2 parents 8ef7c25 + f0894cf commit 27fadf9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/baseClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function getFetch(): Fetch {
2626
return window.fetch.bind(window);
2727
}
2828
if (typeof global !== 'undefined' && global.fetch) {
29-
return global.fetch;
29+
return global.fetch.bind(global);
3030
}
3131
if (typeof fetch !== 'undefined') {
3232
return fetch.bind(globalThis);

0 commit comments

Comments
 (0)