Warning about notFoundError is shown when rendering root route and there's no defaultNotFoundComponent set, even though it renders successfully.
Error message:
Warning: A notFoundError was encountered on the route with ID "__root__", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<div>Not Found<div>)
Your Example Website or App
Warning: A notFoundError was encountered on the route with ID "root", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (
I had that error my first time using start, and I solved it by adding the notFound component, but nevertheless it has been marked as a bug since it does seem to be one. I would like to work on that as my first contribution.
Which project does this relate to?
Start
Describe the bug
Warning about notFoundError is shown when rendering root route and there's no defaultNotFoundComponent set, even though it renders successfully.
Error message:
Warning: A notFoundError was encountered on the route with ID "__root__", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<div>Not Found<div>)
Your Example Website or App
Warning: A notFoundError was encountered on the route with ID "root", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (
Steps to Reproduce the Bug or Issue
Expected behavior
Warning should not appear when there's no defaultNotFoundError set.
Screenshots or Videos
Platform
Additional context
Discord thread where @schiller-manuel helped me and told me to create new issue https://discord.com/channels/719702312431386674/1238170697650405547/1291393654765650033
I had that error my first time using start, and I solved it by adding the notFound component, but nevertheless it has been marked as a bug since it does seem to be one. I would like to work on that as my first contribution.
@soyricardodev adding the
notFoundComponent
just silences this warning. however, there shouldn't even a not found error be thrown here.