http icon indicating copy to clipboard operation
http copied to clipboard

XMLHttpRequest `response` property doesn't exist in IE9

Open toretore opened this issue 8 years ago • 2 comments

The response property as used here:

https://github.com/elm-lang/http/blob/master/src/Native/Http.js#L154

was only added to IE10 according to https://msdn.microsoft.com/en-us/library/hh872881(v=vs.85).aspx

This results in a "Given an invalid JSON" error, or "This is not valid JSON!" in master at

https://github.com/elm-lang/core/blob/master/src/Elm/Kernel/Json.js#L149

as string will be undefined.

I'm not sure about the correct solution, especially with streaming or large payloads, but I've confirmed that in my simple case of a small JSON response, manually changing the generated JS to use responseText makes it work in IE9.

Edit: I should add that this is tested in IE11 in IE9 "document mode".

toretore avatar Aug 04 '17 10:08 toretore

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

process-bot avatar Aug 04 '17 10:08 process-bot

I'm having the same issue. Just as a reference, this is how superagent handles response and responseText here and here.

harmboschloo avatar Oct 06 '17 09:10 harmboschloo