Skip to content

fix(docs): Add pending component to prevent loader data destructure error - #1297

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

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

Conversation

@sentry

@sentry sentry Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

This PR addresses a TypeError: Cannot destructure property 'content' of 'f.useLoaderData(...)' as it is undefined. that occurred in the docs route (src/routes/_library/$libraryId/$version.docs.$.tsx) during client-side navigation.

The root cause was that the Docs component would attempt to unconditionally destructure the result of Route.useLoaderData() before the loader had resolved. During client-side navigation, useLoaderData() returns undefined until the data is ready, leading to a crash.

To fix this, a DocsPending component has been introduced and registered as the pendingComponent for the route. This ensures that a loading skeleton is displayed while the loader is fetching data, and the Docs component only renders once the loader data is available, preventing the destructuring error.

Fixes TANSTACK-COM-54M

@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.

@coderabbitai

coderabbitai Bot commented Sep 25, 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: b69343d3-e714-4105-b2ea-e7c8eeffa5ae

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

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

cloudflare-workers-and-pages Bot commented Sep 25, 2026 •

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 67743c0 Commit Preview URL

Branch Preview URL
Sep 25 2026, 11:10 AM

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.

0 participants