Skip to content

notFound() won't emit head data if __root has an async loader #6085

@paperclover

Description

@paperclover

Which project does this relate to?

Router

Describe the bug

when having a route's loader throw notFound, the not found page is rendered without head if the __root route's loader is not complete.

Your Example Website or App

https://github.com/paperclover/bug-reproductions/tree/tanstack-start-head-omitted

Steps to Reproduce the Bug or Issue

  • npm i
  • npm run dev
  • open http://localhost:3000, navigate to see css exists
  • open http://localhost:3000/not-found on new tab, no css

Expected behavior

to wait for __root's loader and render the head data.

Screenshots or Videos

No response

Platform

  • Router / Start Version: 1.130.2 / 1.135.2
  • OS: macOS
  • Browser: N/A
  • Browser Version: N/A
  • Bundler: vite
  • Bundler Version: ^7.1.7

Additional context

blocking a pr at work to properly handle some 404 cases where we are actually showing our ErrorComponent

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