the error occur when i try to download anything bigger than 50kb. I tried a lot of ways: using standard angular http client, xhr request, xhr request in zone.runOutsideAngular. But seams to get the same mistake every time. But when i tested same request from vanilla javascript it worked like a charm. Text of my request looks like this.
this.zone.runOutsideAngular(() => {
let url = environment.backEndHttpsUrl + 'some_backend_path';
this.xhr.withCredentials = true;
this.xhr.responseType = 'blob';
this.xhr.open('GET', url, true);
const fileName = 'some name constructing method';
this.xhr.onload = () => {
console.log(this.xhr.response);
let blob = this.xhr.response;
FileSaver.saveAs(blob, fileName);
};
this.xhr.send();
});
method using angular httpClient :
return this.http.get(environment.backEndHttpsUrl + 'some request building logic',
{
withCredentials: true,
responseType: 'blob',
}).toPromise()