Meteor - Requests randomly failing

131 views Asked by At

I have this weird problem where some requests fails randomly. I have no idea what is causing this behavior. Sometimes it is images not loading and sometimes it is ajax request (cfs/severtime or algolia-search) and some other times everything is fine. It also happen in local and online. Here are two different screenshots where different resources fails to load after refreshing the browser.

enter image description here enter image description here

2

There are 2 answers

0
Frank6 On BEST ANSWER

Finally found the source of my problem maybe my answer would help other Meteor developers.

I used to do this :

var providersSub = Meteor.subscribe('providers');

Tracker.autorun(function () {
  if(!providersSub.ready())
    return;

  var providerIds = _.pluck(Provider.all().fetch(), '_id'));      
  ...
  this.stop();
});

Instead of :

var providersSub = Meteor.subscribe('providers');

Tracker.autorun(function (computation) {
  if(!providersSub.ready())
    return;

  var providerIds = _.pluck(Provider.all().fetch(), '_id'));      
  ...
  computation.stop();
});
2
user980989 On

take a look at this: What does status=canceled for a resource mean in Chrome Developer Tools?

it seems that your requests aren't failing, they're being canceled by chrome. this usually happens because some javascript alters the DOM and it doesn't end up needing a resource it had started to request. are there any resources that are actually missing from the page once it's rendered?