Trying to fetch large JSON data is returned as null on Chrome. Works on Firefox

Discussão em 'Angular' iniciado por AngularBoi, Novembro 5, 2024.

  1. AngularBoi

    AngularBoi Guest

    We are trying to fetch a large amount of JSON data from a REST API. The data is rows of sales data. We used to have a problem with timeouts and crashes when fetching a large amount of data, but we solved those issues by streaming the response to the browser.

    The current issue we have is that when we try to fetch a very large amount of data the API returns 200 OK but the response body is null in the browser. No errors are received. This happens when the data is somewhere around 500 - 600mb, before that it works as expected. This only happens on Chromium-based browsers (Chrome, Edge). On Firefox the JSON data is returned as expected.

    If we listen to the http events and log them in the browser, we can see that the data is correctly transmitted all the way, but only when the request completes does the body become null.

    Our best guess is that the browser can't handle the amount of data in memory, But in that case we expect an error of some kind.

    Any ideas why the response body is set to null?

    Continue reading...

Compartilhe esta Página