Skip to content

Commit

Permalink
potential fix for issue-3
Browse files Browse the repository at this point in the history
  • Loading branch information
zfedoran committed Nov 4, 2023
1 parent 31bf335 commit 50608b2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/client/src/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ class Connection {
constructor(endpoint: string, fetch: Function = globalThis.fetch) {
// The Fetch API is supported experimentally in Node 17.5+ and natively in Node 18+.
this.endpoint = endpoint;
this.fetch = fetch;

// Ensure that the fetch function is called with the right context and
// doesn't trigger "Illegal invocation".
this.fetch = (...args: any) => fetch.apply(globalThis, args);
}

/**
Expand Down

0 comments on commit 50608b2

Please sign in to comment.