Browser Request Cancellation Test

Current Environment

Loading...

Cancellation Error

FieldValue
.toString()
.name
.message
.stack

What Is This?

This website details the error when a fetch request gets cancelled in this browser.

Most browsers will cancel ongoing or queued fetch tasks, when unloading the document (spec). It usually happens when navigating away from the current page, which causes a fetch error if there is an unfinished request.

However, browsers are behaving differently and throwing different errors (listed below). It can be really annoying to differentiate them from normal errors if you are using Sentry to report client errors, or showing a “failed to fetch” hint in the UI.

If you want to reproduce this error by yourself, make sure you have DevTools opened and “Preserve Log” checked, then click /test. You will see a failed network request and a printed error in the console.

You can also find the source code of this website on GitHub.

Test Results for Common Browsers

FieldChrome 95Safari 14iOS Safari 14Safari 15Firefox 94
.toString()TypeError: Failed to fetchTypeError: cancelledTypeError: cancelledTypeError: Load failedTypeError: NetworkError when attempting to fetch resource.
.nameTypeErrorTypeErrorTypeErrorTypeErrorTypeError
.messageFailed to fetchcancelledcancelledLoad failedNetworkError when attempting to fetch resource.
.stackTypeError: Failed to fetch at ...