Repository navigation
fix(docs): guard against undefined loaderData during route transitions - #1508
sentry[bot] wants to merge 1 commit into
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
tanstack-com | 440ffbe | Commit Preview URL Branch Preview URL |
Nov 17 2026, 11:18 PM |
|
Thanks for catching this. Can we pin down the navigation that loses the loader data and show that the docs recover? An empty container avoids the destructuring error, but we need to know it does not leave the page blank.
|
In both
/_library/$libraryId/$version/docs/framework/$framework/$and/_library/$libraryId/$version/docs/$, theDocscomponent immediately destructured properties such as{ content, filePath, title, freshness, canonicalPathOverride }fromRoute.useLoaderData().During certain client-side navigation transitions, TanStack Router can briefly render a route match before its loader data has arrived, resulting in
Route.useLoaderData()returningundefinedand throwing an unhandledTypeError: Cannot destructure property 'content' from null or undefined value.Changes made:
loaderDatain both docs routes, returning a placeholderDocContaineruntil loader data is populated.Sentry.captureMessageat thewarninglevel so router data races remain visible and traceable without crashing the page.Fixes TANSTACK-COM-419
@sentry <feedback>: Autofix iterates on these changes@sentry stop iterating: Autofix stops iterating on this runThis PR was automatically generated by Sentry. You can adjust this setting at any time.