I noticed a strange caution message when looking at downloaded resources using Google chrome inspector (F12):
Caution provisional headers a
Here is another solution.
If you encounter this issue with $ajax() call, add http://
before your serverhost will solve your problem.
var requestURL = "http://" + serverHost;
$.ajax({
dataType: "json",
url: requestURL,
data: data,
success: success
});
I had a similar issue with my MEAN app. In my case, the issue was happening in only one get request. I tried with removing adblock, tried clearing cache and tried with different browsers. Nothing helped.
finally, I have figured out that the api was trying to return a huge JSON object. When I have tried to send a small object, it was working fine. Finally, I have changed my implementation to return a buffer instead of a JSON.
I wish expressJS to throw an error in this case.
A common reason this happens is if you are tracking an event and you don't prevent the default action. For example, if you have a click event, then you will want to include:
e.preventDefault();
or
return false;
If you don't, you will see the provisional headers warning as well as a "canceled" status in the Network tab of your web console.
This issue occurred to me when I was sending an invalid HTTP Authorization header. I forgot to base64 encode it.
The resource could be being blocked by an extension (AdBlock in my case).
The message is there because the request to retrieve that resource was never made, so the headers being shown are not the real thing. As explained in the issue you referenced, the real headers are updated when the server responds, but there is no response if the request was blocked.
The way I found about the extension that was blocking my resource was through the net-internals tool in Chrome:
For Latest Versions of chrome
chrome://net-export/
in the address bar and hit enter.For Older Versions of chrome
chrome://net-internals
in the address bar and hit enter.Another possible scenario I've seen - the exact same request is being sent again just after few milliseconds (most likely due to a bug in the client side).
In that case you'll also see that the status of the first request is "canceled" and that the latency is only several milliseconds.