Skip to content

main.tsx defaultNotFound component is being rendered instead a root pathless route notFoundComponent #6351

Closed

Description

@rahulvils

Which project does this relate to?

Router

Describe the bug

root pathless notFound is not rendering instead of main.tsx defaultNotFoundComponent is being triggered.

Your Example Website or App

https://github.com/rahulvils/tanstack-router-not-found

Steps to Reproduce the Bug or Issue

  1. Clone the repository
  2. Run pnpm i
  3. Run pnpm dev
  4. Open http://localhost:3000 in your browser
  5. Click on the Skill Agent button in the home page, You will be redirected to skill-agent page
  6. Now manually go the the route to trigger not-found component http://localhost:3000/agents/skill-agen
  7. The not-found component in the _authenticated/agents/route.tsx will be triggered (Which is expected)
  8. Now go the location in the codebase _authenticated/agents/route.tsx and comment the notFoundComponent
  9. Now navigate to the same link http://localhost:3000/agents/skill-age the main.tsx defaultNotFoundComponent is being triggered instead of _authenticated.tsx notFound component

Expected behavior

For root pathless route (say routes/_authenticated.tsx) the notFound component is not being triggered and main.tsx defaultNotFoundComponent is being triggered. I didn't change the default behaviour of notFoundMode (which is fuzzy)

Screenshots or Videos

No response

Platform

  • Router Version: 1.147.0
  • OS: Linux (Ubuntu 24.04)
  • Browser: Chrome
  • Browser Version: 143.0.7499.192 (Official Build) (64-bit)
  • Bundler: Vite
  • Bundler Version: 7.1.1

Additional context

No response

Activity

  1. rahulvils commented on Jan 10, 2026

    @rahulvils
    Author
  2. missish commented on Jan 14, 2026

    @missish

    This appears to be the same issue as #4065, which was reported back in April 2025 — over 8 months ago. It seems like the notFoundComponent on pathless layout routes has been broken for quite a while now. Is there any update on when this might be addressed? Many users seem to be affected by this.

  3. rahulxdemon commented on Jan 14, 2026

    @rahulxdemon

    This is the latest version and I still have not resolved

  4. rahulxdemon commented on Aug 5, 2026

    @rahulxdemon

    This issue is fixed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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