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
Core Web Vitals aren't reported when enabling Tanstack Router integration #18425
All the Core Web Vitals reported on Sentry in the trace, including LCP and CLS.
Actual Result
Only TTFB (and FCP in certain cases are reported) are reported.
Additional Context
Note: Web vitals are correctly reported when disabling the tanstack integration.
After turning on debug mode, it appears that on initial page load the tanstack integration always stop the pageload root span to create a new navigation span. Based on my understanding of how custom routing should be implemented the tanstack router integration should preserving the ongoing pageload span to enable the browser tracing integration to attach the webvitals metrics.
Priority
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.
Hi @pmdartus please try removing browserTracingIntegration and only registering tanstackRouterBrowserTracingIntegration . Let us know if this is still an issue afterwards.
Most likely, the two instrumentations just cancel each other out, because both start a pageload span.
It is still reproducible with tanstackRouterBrowserTracingIntegration only. I updated the sample repo as well. Digging deeper it appears that the following expression evaluates to false on the initial page load.
Thanks @pmdartus for the investigation, you are correct. I confirmed the issue, looks like fromLocation can be undefined which would cause a partial of the metrics to be reported.
I'm creating a PR now to fix it. I just can't see to trigger it in a live test.
Activity
linear commentedon Dec 9, 2025
JS-1264
Lms24 commentedon Dec 9, 2025
Hi @pmdartus please try removing
browserTracingIntegrationand only registeringtanstackRouterBrowserTracingIntegration. Let us know if this is still an issue afterwards.Most likely, the two instrumentations just cancel each other out, because both start a
pageloadspan.11 remaining items
pmdartus commentedon Dec 9, 2025
Thanks for looking into this @Lms24.
It is still reproducible with
tanstackRouterBrowserTracingIntegrationonly. I updated the sample repo as well. Digging deeper it appears that the following expression evaluates tofalseon the initial page load.sentry-javascript/packages/react/src/tanstackrouter.ts
Lines 67 to 70 in c786fc5
Since the
fromLocationisundefined, I think the condition should rather be:What do you think?
logaretm commentedon Dec 10, 2025
Thanks @pmdartus for the investigation, you are correct. I confirmed the issue, looks like
fromLocationcan beundefinedwhich would cause a partial of the metrics to be reported.I'm creating a PR now to fix it. I just can't see to trigger it in a live test.
fromLocationexistence before reporting pageload #18464 as a duplicate of this issuefromLocationexistence before reporting pageload #18464 as a duplicate of this issuefix(tanstack-router): Check for `fromLocation` existence before repor…
github-actions commentedon Dec 16, 2025
A PR closing this issue has just been released 🚀
This issue was referenced by PR #18463, which was included in the 10.31.0 release.