elm / http

Make HTTP requests in Elm
https://package.elm-lang.org/packages/elm/http/latest
BSD 3-Clause "New" or "Revised" License
155 stars 46 forks source link

XMLHttpRequest `response` property doesn't exist in IE9 #32

Open toretore opened 7 years ago

toretore commented 7 years ago

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".

process-bot commented 7 years ago

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.

harmboschloo commented 6 years ago

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