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
{{ message }}
Repository navigation
Always attach some URL/target data point to fetch/xhr/request errors #13168
We technically have a stack trace here but sourcemaps are broken so the user has basically no idea what fetch request failed. It's very hard to gauge from breadcrumbs what exact request failed.
Side note, the fetch call that failed looked like fetch(""). We render this as in the product, you guessed it "". Which is crap because it actually means the request went to the current route. We should at least coerce that string to URL(fetchTarget, window.location.href).toString() in the SDK.
Hii, i was working on this issue & i think there are two separate things going on;
Message: enhanceFetchErrorMessages already appends the host, but it calls new URL(url) without a base, so relative URLs (including "") throw and are silently skipped.
I added test in core/test/lib/instrument/fetch.test.ts , it failed.
Before:
For this part I've made a PR - #25555 with 6 unit tests, (relative URL, empty URL, no location, file:// origin, opaque null origin, absolute URL on another origin) all passed.
Breadcrumbs: The empty URL in breadcrumbs is a separate spot - "" is stored as-is in breadcrumbs.ts. Coercing it with new URL(target, location.href) would work, but since new URL('', base).href keeps the base’s query string (not the hash, that’s dropped), it would leak query params like ?token=... into the breadcrumb.
want the full resolved URL anyway, or should the query be stripped before storing it?
Activity
kunal649 commentedon Oct 20, 2026
Hii, i was working on this issue & i think there are two separate things going on;
enhanceFetchErrorMessagesalready appends the host, but it callsnew URL(url)without a base, so relative URLs (including"") throw and are silently skipped.sentry-javascript/packages/core/src/instrument/fetch.ts
Lines 138 to 153 in 3d47e12
I added test in core/test/lib/instrument/fetch.test.ts , it failed.

Before:
For this part I've made a PR - #25555 with 6 unit tests, (relative URL, empty URL, no
location,file://origin, opaquenullorigin, absolute URL on another origin) all passed.new URL('', base).hrefkeeps the base’s query string (not the hash, that’s dropped), it would leak query params like ?token=... into the breadcrumb.want the full resolved URL anyway, or should the query be stripped before storing it?
lforst commentedon Oct 20, 2026
big