Skip to content

_root.tsx missing notFoundComponent => error message #5757

@myoussef3030

Description

@myoussef3030

Which project does this relate to?

Router

Describe the bug

__root.tsx is missing notFoundComponent => error message
adding the following code to __root.tsx removes the error message:

notFoundComponent: () => {
	return <p>This page doesn't exist!</p>;
},

Your Example Website or App

localhost.com

Steps to Reproduce the Bug or Issue

error appears as soon as app starts

Expected behavior

Error message to disappear:

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 (

Not Found
)

Screenshots or Videos

No response

Platform

  • Router / Start Version: [e.g. 1.121.0]
  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Browser Version: [e.g. 91.1]
  • Bundler: [e.g. vite]
  • Bundler Version: [e.g. 7.0.0]

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions