Skip to content
Source
Sign inSign up
TanStack/router

Unexpected render of notFoundComponent when generic error is thrown #2478

Send to my agent
Closedlislon(GitHub profile, opens in a new tab) opened this issue 0 comments

Which project does this relate to?

Router

Describe the bug

I have both notFoundComponent and errorComponent defined on __root. When there is an error in loader or in child routes components, there is unexpected render of notFound component

Your Example Website or App

https://stackblitz.com/edit/github-shvffc?file=src%2Froutes%2F__root.tsx

Steps to Reproduce the Bug or Issue

  1. define a root route with notFoundComponent and errorComponent
  2. throw error in loader or in component of root or any child component

Expected behavior

only root's errorComponent will be rendered

Screenshots or Videos

notFoundComponent is rendered

Image

Platform

  • OS: Windows
  • Browser Chrome
  • Version: 129.0.6668.90 (Official Build) (64-bit)

Additional context

No response

  1. SeanCassiere added labelsbug

Sign in to join this conversation.