Skip to content

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

@EliRibble

Description

@EliRibble

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions