Repository navigation
fix(charts): Guard against undefined loader data in ChartsCatalogCaseRoute - #1285
sentry[bot] wants to merge 1 commit into
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
tanstack-com | 2984a77 | Commit Preview URL Branch Preview URL |
Sep 21 2026, 11:04 AM |
|
Closing this as a duplicate of #1215, which targets the same undefined data.case access in ChartsCatalogCaseRoute. I copied the 40-geojson-map to 39-density-contours transition and TANSTACK-COM-4RJ link into that discussion so the additional incident detail stays visible. The underlying bug is still open there. Neither a null return nor a permanent pending view has been verified as the root-cause fix. |
This PR addresses a
TypeError: undefined is not an object (evaluating 'e.useLoaderData().case')that occurred inChartsCatalogCaseRoute.The root cause was that
ChartsCatalogCaseRouteunconditionally accesseddata.casefromRoute.useLoaderData(). During navigation between$caseIdparameters (e.g.,40-geojson-map→39-density-contours), TanStack Router can render the component before the new loader resolves, causinguseLoaderData()to returnundefined.The fix adds a null guard (
if (!data) return null) toChartsCatalogCaseRouteinsrc/routes/_library/charts.catalog.charts.$caseId.tsx. This prevents accessingdata.casewhendatais undefined, aligning with the defensive check already present in the route'shead()function and ensuring the component gracefully handles pending loader data.Fixes TANSTACK-COM-4RJ
@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.