GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Always attach some URL/target data point to fetch/xhr/request errors · Issue #13168 · getsentry/sentry-javascript

Always attach some URL/target data point to fetch/xhr/request errors #13168

New issue
Copy link
New issue
Copy link
Closed
Closed
Always attach some URL/target data point to fetch/xhr/request errors#13168
Copy link
Assignees
s1gr1d
Labels
BrowserErrorsImprovement

Description

@lforst
lforst
opened on Aug 2, 2024
Issue body actions

Description

The Sentry Chief Product Officer has brought to our attention that Fetch errors sometimes suck. (example that will expire in 90 days)

Image

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.

Image

Reacted by Peter Sandtner

Activity

Next
  1. AbhiPrasad
    added
    Feature: Errors
    Package: browser
    on Nov 1, 2024
  2. linear
    added
    Migrated
    on Jan 9, 2025
  3. stephanie-anderson
    removed
    Migrated
    on Mar 13, 2025
  4. ghost added
    getsentry/sentry-javascript
    on Apr 7, 2025
  5. linear
    added
    Improvement
    SDKs (New)
    on Apr 7, 2025
  6. stephanie-anderson
    removed
    SDKs (New)
    getsentry/sentry-javascript
    on Apr 8, 2025
  7. stephanie-anderson
    added
    Errors
    and removed
    Feature: Errors
    on Apr 30, 2025
  8. stephanie-anderson
    removed the
    Improvement
    issue type on Aug 12, 2025
  9. chargome
    added
    Browser
    and removed
    Package: browser
    on Mar 20, 2026
  10. kunal649 commented on Oct 20, 2026

    @kunal649
    kunal649
    on Oct 20, 2026 · Hidden as resolved
    show commentMore actions
  11. 6 remaining items

  12. getsantry
    moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Oct 20, 2026
  13. kunal649 commented on Oct 28, 2026

    @kunal649
    kunal649
    on Oct 28, 2026
    Contributor
    More actions

    Found 1 more spot , i think xhr.open('GET', '') is never instrumented, because the check in xhr.ts is !url, which treats an empty string like an unparseable argument. fetch('') does get a breadcrumb and span.

    sentry-javascript/packages/browser-utils/src/instrumentation/xhr.ts

    Lines 54 to 56 in 90a71e7

    if (!method || !url) {
    return originalOpen.apply(xhrOpenThisArg, xhrOpenArgArray);
    }

    Should i open a small PR that only bails when the URL can't be parsed (url === undefined)? - @s1gr1d wdyt should empty-URL XHRs stay uninstrumented?

  14. sentry-junior
    added
    Waiting for: Product Owner
    on Nov 5, 2026
  15. s1gr1d commented on Nov 6, 2026

    @s1gr1d
    s1gr1d
    on Nov 6, 2026
    Member
    More actions

    Good find, yes please! fetch('') is already instrumented, so XHR should match and bailing only on url === undefined sounds correct.

    Can you also handle the breadcrumb URL in the same PR (your question from the first comment, now hidden)? Once xhr.open('GET', '') is instrumented, its breadcrumb would show "" too (same as fetch).

    When we resolve the url with location.href (like your PR #25784 does) and then stripping query and fragment (stripUrlQueryAndFragment in core) we can get the path without leaking params into breadcrumbs.

  16. sentry-junior
    removed
    Waiting for: Product Owner
    on Nov 6, 2026
  17. kunal649 commented on Nov 7, 2026

    @kunal649
    kunal649
    on Nov 7, 2026
    Contributor
    More actions

    opened a PR with both changes, take a look when you get a chance.

    Reacted by Sigrid
  18. sentry-junior
    added
    Waiting for: Product Owner
    on Nov 7, 2026
  19. nicohrubec
    removed
    Waiting for: Product Owner
    on Nov 9, 2026
  20. s1gr1d
    added a commit that references this issue on Nov 11, 2026

    fix(browser): Instrument empty-URL XHR and show the page URL in bread…

    15f3d8d
  21. kunal649 commented on Nov 12, 2026

    @kunal649
    kunal649
    on Nov 12, 2026
    Contributor
    More actions

    Can it be closed now?

    Reacted by Martin Sonnberger
  22. getsantry
    added
    Waiting for: Product Owner
    on Nov 12, 2026
  23. getsantry
    moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Nov 12, 2026
  24. msonnb
    closed this as completedon Nov 13, 2026
  25. getsantry
    removed
    Waiting for: Product Owner
    on Nov 13, 2026
  26. s1gr1d commented on Nov 13, 2026

    @s1gr1d
    s1gr1d
    on Nov 13, 2026
    Member
    More actions

    Yes, thanks a lot for all three PRs!

    • fix(core): Resolve relative URLs when enhancing fetch error messages #25555
    • fix(browser): resolve request URLs against location.href in tracing #25784
    • fix(browser): Instrument empty-URL XHR and show the page URL in breadcrumbs #26201
    Reacted by whatever_kunaal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @s1gr1d
    s1gr1d

Labels

BrowserErrorsImprovement

Projects

  • GitHub Issues with 👀 3
    Status
    Waiting for: Product Owner
    Show more project fields

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.