-
Notifications
You must be signed in to change notification settings - Fork 102
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
IE11 InvalidErrorStatus #64
Comments
Any updates on this? We're getting these errors too. |
I ended up writing a small shim for the request module that fit our very targeted needs (implemented the very minimum that we use from the request module). I would strongly prefer the browser-request module, but to get around this bug we used the shim (note that it assumes jquery is on the page as $). module.exports = {
get: function(options, callback){
$.ajax({
url: options.url,
timeout: options.timeout,
dataType: options.json === true ? 'json' : null,
error: function(jqXHR, textStatus, errorThrown) {
var errorMessage = "Error occurred while requesting " + options.url + ".";
if (textStatus) {
errorMessage += " Error status: " + textStatus;
if (errorThrown && errorThrown !== textStatus) {
errorMessage += " | Error Thrown: " + errorThrown;
}
}
var error = new Error(errorMessage);
if (textStatus === 'timeout') {
error.code === 'ETIMEDOUT'
}
error.status = jqXHR.status;
callback(error);
},
success: function(data, textStatus, jqXHR){
var responseObj = {
statusCode: jqXHR.status,
body: data
};
callback(null, responseObj, data);
}
});
}
}; In package.json I added this:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using the browser-request module in IE11 causes an InvalidStateError to occur.
The request code looks like this:
I have a nodejs module that requires the "request" module which on the browser (via browserify) uses the browser-request module. I've mapped this module correlation in my package.json like this:
Note that the request actually appears to work just fine, but IE logs an error
Here is a screenshot of the error in IE11 Developer Tools
The text was updated successfully, but these errors were encountered: