You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are getting thousands of "TypeError: Load failed" errors in Sentry and this appears to be because PostHog has a request in flight while we are redirecting the user to an external URL.
From my understanding, XMLHttpRequest does not have a mechanism like keepalive that will not cancel the request when the page is unloaded.
Fetch is available on every major supported browser. Could fetch be made the default? If not, could an option be provided to make it the default for our instance?
Alternatively, it could be helpful to have a method that returns a promise that resolves when all the pending events have been sent so we can block the redirect on that request, but that seems unnecessary with keepalive.
The text was updated successfully, but these errors were encountered:
We are getting thousands of "TypeError: Load failed" errors in Sentry and this appears to be because PostHog has a request in flight while we are redirecting the user to an external URL.
It looks like this is because XMLHttpRequest is preferred over fetch.
posthog-js/src/request.ts
Lines 202 to 216 in 38744a5
Indeed,
XHR
is the default transport:posthog-js/src/request.ts
Line 237 in 38744a5
From my understanding, XMLHttpRequest does not have a mechanism like keepalive that will not cancel the request when the page is unloaded.
Fetch is available on every major supported browser. Could
fetch
be made the default? If not, could an option be provided to make it the default for our instance?Alternatively, it could be helpful to have a method that returns a promise that resolves when all the pending events have been sent so we can block the redirect on that request, but that seems unnecessary with keepalive.
The text was updated successfully, but these errors were encountered: