Barba: @barba/prefetch - Error: Timeout error [2000] at XMLHttpRequest.o.ontimeout

Created on 16 May 2019  路  3Comments  路  Source: barbajs/barba

Hi,

In debug true, I get this error on first load and then entering a page :

[@barba/prefetch] Error: Timeout error [2000] at XMLHttpRequest.o.ontimeout (barba.umd.js:1)

It seems to display everytime it prefetchs a link, because I get it multiple times.

I'm using :
@barba/core: 2.3.9
@barba/prefetch: 2.1.3

This doesn't break anything but I thought it could be useful to bring it up,

Olivier

Most helpful comment

Hi/Salut @oguilleux !

This issue is related to this one: https://github.com/barbajs/barba/issues/373.
The timeout error is due to a long delay of response from your web page.

You can adjust the timeout on barba.init using:

barba.init({
  timeout: 5000 // default is 2000ms
})

In addition, you can catch the error using the requestError setting:
https://barba.js.org/docs/v2/user/core.html#requesterror

Hope this help! :wink:

All 3 comments

Hi/Salut @oguilleux !

This issue is related to this one: https://github.com/barbajs/barba/issues/373.
The timeout error is due to a long delay of response from your web page.

You can adjust the timeout on barba.init using:

barba.init({
  timeout: 5000 // default is 2000ms
})

In addition, you can catch the error using the requestError setting:
https://barba.js.org/docs/v2/user/core.html#requesterror

Hope this help! :wink:

Hey @xavierfoucrier

I didn't even think about changing the timeout : giving barba more time to prefetch the pages worked.

Thanks for the tip :)

@oguilleux Perfect! :beers:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pierredarrieutort picture pierredarrieutort  路  3Comments

pburdylo picture pburdylo  路  3Comments

shanewmurphy picture shanewmurphy  路  3Comments

Mellis84 picture Mellis84  路  3Comments

S1SYPHOS picture S1SYPHOS  路  3Comments