Skip to content

head is not executed when beforeLoad throws an Error #4684

Description

@KiwiKilian

Which project does this relate to?

Router

Describe the bug

Following up on #3657.

When an error is thrown from beforeLoad, head is never executed. Maybe this should be considered, to allow modifying the head, when showing the errorComponent.

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-ydfwwss9?file=src%2Froutes%2F__root.tsx

Steps to Reproduce the Bug or Issue

Open the link and see, the global styles and title set via head are missing.

Expected behavior

head should be executed an included via the shellComponent and HeadContent.

Screenshots or Videos

No response

Platform

  • Router / Start Version: 1.128.0

Additional context

Created this issue, as @schiller-manuel told me, it might be a bug 😄.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions