Skip to content

Throwing 404 in loader causes parent route to "freeze" #5106

Description

@budde377

Which project does this relate to?

Start

Describe the bug

Given two routes:

  • A post list component with an rendering the post details: /posts.tsx
  • The nested post details: /posts.$postId.tsx

when I thrown an error in the loader of the nested post route, the component of the parent route does not render. The component is rendered server-side, but the component function is not called. This causes any effects or click handlers to not be executed or added.

Your Example Website or App

https://github.com/TanStack/router/tree/main/examples/react/start-basic

Steps to Reproduce the Bug or Issue

  1. Checkout the start-basic example from the docs (npx gitpick TanStack/router/tree/main/examples/react/start-basic start-basic)
  2. Install and run with yarn dev
  3. Add a console log statement PostsComponent (or use your browser's debugger if you feel fancy)
  4. Go to http://localhost:3000/posts/i-do-not-exist
  5. Notice the log statement is not being executed.

Expected behavior

I expect the browser to run the component and make the DOM reactive.

Screenshots or Videos

No response

Platform

  • Router / Start Version: 1.131.36
  • OS: macS
  • Browser: Dia
  • Browser Version: Version 0.44.1 (67960)
  • Bundler: vite
  • Bundler Version: 6.3.5

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions