Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: 'fetch' called on an object that does not implement interface Window #74

Open
EliRibble opened this issue Aug 27, 2024 · 0 comments

Comments

@EliRibble
Copy link

I'm running on Firefox. Using the suggested sample code:

let client = new Client({
 ...
 transport: new FetchTransport(fetch)
})
client.fetchSession()...

Produces the error: TypeError: 'fetch' called on an object that does not implement interface Window. I think this has to do with rebinding fetch(). Instead, the following works for me:

let client = new Client({
 ...
 transport: new FetchTransport(fetch.bind(window))
})
client.fetchSession()...

See this Stack Overflow for possible explanation.

@EliRibble EliRibble changed the title TypeError: 'fetch' called on an object that does not implement interface Window [duplicate] TypeError: 'fetch' called on an object that does not implement interface Window Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant