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

Error with timeout in ie11 #5

Closed
tume opened this issue Mar 22, 2015 · 2 comments
Closed

Error with timeout in ie11 #5

tume opened this issue Mar 22, 2015 · 2 comments

Comments

@tume
Copy link
Contributor

tume commented Mar 22, 2015

I'm getting InvalidStateError with ie11 when doing requests and the "culprit" seems to be this line:

req.xhr.timeout = timeout;

If I remove it everything works fine. Not sure what is the actual cause because didn't have time to debug this more but my guess is that it is setting timeout too early/late and for some reason ie doesn't like it.

Superagent seems to provide some timeout support also so one option might be using that if possible?

One other related note is that would be nice to be able to skip the timeout by specifying 0 which is not really possible at the moment.

@stephanebachelier
Copy link
Owner

@tume I need to review this timeout logic. It was not tested correctly and it does not behave correctly. I'm thinking about rolling back.
I know that superagent provide a support for timeout but it was not working as intended, or in other words not as I needed.

I'll come back soon with a better solution.

@krasimir
Copy link

Just for the record. The bug is gone (in IE11) if you set the timeout after the open method. So if you have

xhr.timeout = 5000;
xhr.open("GET", 'http://....', true);

you'll get the exception. The following works fine:

xhr.open("GET", 'http://....', true);
xhr.timeout = 5000;

I guess the lovely IE11 wants to have the XHR object initialized before getting more commands.

cc @stephanebachelier @tume

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

3 participants