See the entries
The entries aren't shown and the loader stays where it is. The error occurs in the method showBlankState(). The reason is that the value of this.props.items is a string and not an array. Therefore, IE isn't able to access the property results and this code this.props.items.results.length generates an error.
I found out that the issue is due to https://github.com/naugtur/xhr/issues/123.
Issue is due to IE not handling responseType correctly. If you can't bet on responseType in your supported browsers, set json option to true instead of using responseType.
@JedWatson did you have a chance to look at this issue?
I've done some further research and the solution proposed isn't viable. When json is set to true, it expects a serializable object to be set as the value of the body option. The CMS sends a FormData object which is not serializable.
In that case it's even simpler.
Froget setting json at all, receive a string and run JSON.parse. You also gain more control over situations where it wouldn't parse.
@JedWatson This seems pretty critical - not supporting an entire browser. How do you want to go about fixing this?
Guys, point me to instructions and write failing tests in a branch and I can fix that for you. Or get one of my students to choose this as their first PR :)
We currently don't run tests in IE, else this would most likely have been picked up by them.
A PR that fixes it is always welcome though!
An easy workaround for accessing the items only (e.g. no add or edit) is to add the following snippet:
if (typeof data === 'string') {
data = JSON.parse(data);
}
to all the XHR requests that return a JSON file. Specifically, those are the calls that have responseType: 'json'. They can be find in the following files:
In general the snippet must go before data is used in the callback of the Ajax call.
I did the same thing when reaching this issue, and solve by a solution from @AurelioDeRosa.
Most helpful comment
An easy workaround for accessing the items only (e.g. no add or edit) is to add the following snippet:
to all the XHR requests that return a JSON file. Specifically, those are the calls that have
responseType: 'json'. They can be find in the following files:In general the snippet must go before
datais used in the callback of the Ajax call.