So I have an issue on local When I make a request I get the data, on Dev/QA/Prod nothing comes back I checked the network dev tools on my browser and I see that the request is being cancelled
Asked
Active
Viewed 1,218 times
2 Answers
1
So this happens when you return/reload window before the call finishes (the API call made is still being processed and has not completed).
onRemove = (evt) => {
evt.preventDefault();
evt.stopPropagation();
this.props.onRemove(this.props.item);
window.location.reload(); // this will cancel the call and your request wont
//be execute.
}
Removing this will sort the issue -> " window.location.reload();" The best thing to do is to make sure that you wait for the request to be processed before you do any other thing.
onRemove = (evt) => {
evt.preventDefault();
evt.stopPropagation();
this.props.onRemove(this.props.item);
}

ishm
- 21
- 5
0
In my case, it was some changes inside my code after api calling for example some state has been changed so my api call cancelled because it hasn't get the response first it operations are parallel and not async. check you code for that and see if there is some logic like that to broke you api call.

B1zzle
- 461
- 1
- 5
- 11