RxJS version: 5.5.2
Code to reproduce:
Please find test cases in the PR which will follow up the issue.
Expected behavior:
AjaxObservable sends an error to subscribers which could be caught using catchError operator.
Actual behavior:
If responseType is '' in response, but it was set to json in request and xhr's response or responseText is not valid JSON, the unhandled error "Invalid character" is thrown.
Additional information:
The error is reproducible with IE11 only. Once the resource is not found, there is a proxy on our server, which overtakes the response and returns HTML 404 page.