★ wanayoo — archive 1999 https://github.com/orbitjs/orbit/issues/452Nouvelle recherche | Portail wanayoo
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

Network error: TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation #452

Closed
morgler opened this issue Aug 12, 2017 · 3 comments
Closed

Comments

@morgler
Copy link

@morgler morgler commented Aug 12, 2017

Using orbitjs 0.15, I got the following error while using JSONAPISource:

Network error: TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation

It seems to be a bug coming from fetch, where a binding is set incorrectly. It also shows in other projects: developit/unfetch#46 or philschatz/octokat.js#180.

The following workaround fixed it for me:

import Orbit from '@orbit/data';
Orbit.fetch = window.fetch.bind(window)

Hope this helps.

@dgeb
Copy link
Member

@dgeb dgeb commented Aug 12, 2017

Thanks. Perhaps we should do that by default when assigning fetch if it exists on self or window (will need to test on a number of platforms first).

@burabure
Copy link
Contributor

@burabure burabure commented Aug 25, 2017

same issue here, I can send a PR with this if you want @dgeb

@dgeb
Copy link
Member

@dgeb dgeb commented Aug 28, 2017

@burabure yes please - a PR would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants