46

I am facing an issue related to loading JSON data.

When I monitor JSON call on Developer Tools of Chrome, I get the following message in the network tab of Chrome Developer Tools.

Caution: request is not finished yet

Attaching a snip for reference:

enter image description here

Itchydon
  • 2,572
  • 6
  • 19
  • 33
Hiral Shah
  • 597
  • 1
  • 4
  • 7
  • 2
    Might be related to this: https://stackoverflow.com/questions/25847083/chrome-just-doesnt-finish-loading-js-files – Gino Mempin Aug 22 '17 at 11:49
  • 5
    Possible duplicate of [Chrome just doesn't finish loading JS files](https://stackoverflow.com/questions/25847083/chrome-just-doesnt-finish-loading-js-files) – M. Prokhorov Aug 22 '17 at 13:33
  • 2
    I doubt it is a duplicate of indicated issue above. We are having same problem after update to chrome version 62. Response is text/html in our case and no keep alive is requested. Chrome for some reason think there will be more response but in reality all was already received and processed by app. Its just makes it difficult to examine result in inspector as it does not populate preview and response tabs. – Stan Oct 30 '17 at 13:59
  • Having this same problem. Any resolution @hiral shah? – jaredrada Dec 15 '17 at 14:46
  • Have you resolved this? Did that 6MB of JSON ever finish loading on the client? If not, can you post the code that is making the request. – Mark Schultheiss Sep 02 '19 at 13:28

4 Answers4

22

It is caused by two-step response loading. If you are using some low-level API, make sure that you fetch not only headers, which arrive first, but also body content that comes later as a stream.

I had the same issue when using the fetch function in JavaScript. To solve it, make sure you call a method that reads the body of the response like json() or text():

// Sends request and loads only headers
fetch('/foo');

// Sends request, loads headers and then fetches the body as JSON
fetch('/foo').then(response => response.json());

In my case response headers were also loaded properly and I had a successful HTTP status code, but I was missing the body content and I had Caution: request is not finished yet inside Chrome Developer Tools.

adrihanu
  • 1,249
  • 2
  • 16
  • 28
2

I ran into this issue due to a programming error that caused an infinite loop in my JavaScript code.

Some time ago Chrome would point out that a script is stuck, but for some reason such a message did not show up in my Chrome. Instead, I found this error in the network tab.

Trying Firefox, it showed the error message "This page is slowing down Firefox. To speed up your browser, stop this page". This helped me figure out that in my case the issue was not related to the request, but was actually caused by a script running forever.

Apparently, the infinite loop in JavaScript causes Chrome to not finalize the request or at least it does not update this display. I am not sure why Chrome would not show a more meaningful error message that a script is stuck.

Falk Tandetzky
  • 5,226
  • 2
  • 15
  • 27
1

In my case, I needed to use response.text() instead of just using response. The usage of just response yields in "Caution: request is not finished yet"

fetch("API_URL_GOES_HERE", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))

A tip here would be: Open Postman's Code snippet and view the actual JS Fetch that is happening.

math_sivi
  • 39
  • 5
0

consider removing all extensions and closing all the browser tabs for me it helped - upon restart, all is well. So strange