Skip to content
Source
Sign inSign up
TanStack/router

`head` is not executed when `beforeLoad` throws an Error #4684

Send to my agent
ClosedKiwiKilian(GitHub profile, opens in a new tab) opened this issue 0 comments

Which project does this relate to?

Router

Describe the bug

Following up on https://github.com/TanStack/router/issues/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 😄.

Sign in to join this conversation.