Skip to content

fix(examples): guard against undefined loader data in route component - #1406

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/examples-loader-data-guard
Open

sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/examples-loader-data-guard

Conversation

@sentry

@sentry sentry Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

During client-side navigation (e.g., transitioning from /table/latest/docs/overview to /table/latest/docs/framework/react/examples/basic), TanStack Router can render the destination route component while the async loader is still pending.

RouteComponent was immediately accessing data.kind without checking if data had resolved, throwing TypeError: can't access property "kind", r is undefined. Adding an early if (!data) return null prevents the crash until the loader resolves.

Fixes TANSTACK-COM-54C

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

This PR was automatically generated by Sentry. You can adjust this setting at any time.

@changeset-bot

changeset-bot Bot commented Oct 20, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 4d6d7bc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bfe19e98-2bfb-44b2-b55c-777ef846d9ad

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
tanstack-com 4d6d7bc Commit Preview URL

Branch Preview URL
Oct 20 2026, 11:16 PM

@tannerlinsley

Copy link
Copy Markdown
Member

Can we include a regression for the navigation that triggers this? I'd like to understand why the loader data is missing before we turn that state into an empty page.

AI review notes:
The change at 4d6d7bcf adds only an early null return in the example route component. It prevents the immediate data.kind access, but adds no regression coverage showing that the example eventually renders.
Please include the event trace or a minimal reproduction behind TANSTACK-COM-54C, and cover navigation from the Table overview to the basic React example, including the pending and resolved states. This is requested coverage, not a claim that the reported navigation failure has been reproduced independently.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant