Errors / JavaScript errors
Uncaught (in promise) …
Something the page asked for in the background failed, and no code was there to handle it.
Sometimes nothing a visitor can see; often a spinner that never stops or a click that does nothing.
Why it happens
- A
fetch()or other promise rejected and nothing called.catch(), or theawaitwas not in atry. - A library rejects with a string or an object instead of an
Error, so the message has no stack:Uncaught (in promise) undefinedor a bare sentence. play()on a video or audio element refused by the browser's autoplay rules.
How to fix it
- Read what follows
(in promise): that is the rejection's reason, and often the real error. - Handle rejections where the promise is made; for code you do not own, a
window.addEventListener("unhandledrejection", …)at least tells you where. - Reject with
new Error(…), never a string, so the next person gets a stack.
Whose problem it is
Either the site's own code or a third party's, depending on where it comes from.
Does your site have it?
Free, no account. We open your page and four more in a clean Chrome and list every error like this one, with the page and the click that caused it. How the free page check works.
Often seen with
- TypeError: Failed to fetchThe page tried to get data from a server and the request never completed.
- play() failed / was interruptedA video or sound tried to play on its own and the browser stopped it.