router icon indicating copy to clipboard operation
router copied to clipboard

Route loader errors stopped bubbling up to nearest error component

Open geoff-harper opened this issue 2 years ago • 4 comments

Describe the bug

Up until a recent-ish beta version (not sure which specifically), errors would bubble up the route tree until it hit a route with an errorComponent or the root. Now it doesn't bubble and uses some boilerplate UI unless I put the custom error component where the error actually happens.

Your Example Website or App

https://stackblitz.com/edit/github-gtqdb6

Steps to Reproduce the Bug or Issue

  1. open /about route

Expected behavior

The error UI div should be rendered instead of the boilerplate

Screenshots or Videos

No response

Platform

Everywhere

Additional context

No response

geoff-harper avatar Sep 11 '23 19:09 geoff-harper

Error bubbling is back!

tannerlinsley avatar Dec 10 '23 06:12 tannerlinsley

I'm still noticing the issue on v1

geoff-harper avatar Dec 27 '23 15:12 geoff-harper

@tannerlinsley, thank you for taking a look. I too am still seeing this issue in 1.15.22.

zavarka avatar Feb 08 '24 13:02 zavarka

can you please find out which version introduced this bug again? this would help fixing this issue.

schiller-manuel avatar Feb 08 '24 18:02 schiller-manuel

is this still relevant?

schiller-manuel avatar Mar 08 '24 15:03 schiller-manuel

The issue is still present in 1.19.2. When an error is thrown in a route that doesn't have an error component, the defaultErrorComponent is used instead of the nearest parent route errorComponent.

GuillaumeLaroucheUQAT avatar Mar 08 '24 20:03 GuillaumeLaroucheUQAT

@schiller-manuel Has there been any progress?

Zebeqo avatar Mar 13 '24 12:03 Zebeqo

I'm also experiencing this issue right now

tien avatar Mar 20 '24 00:03 tien

I can confirm this bug has been fixed in @tanstack/[email protected]

ahkohd avatar Mar 25 '24 10:03 ahkohd

This bug is not fix for me in @tanstack/[email protected]. I have the same behavior as my last comment instead of the one on the section Pathless / Layout Routes from the documentation :

Provide fallbacks for error components or pending elements to child routes

GuillaumeLaroucheUQAT avatar Apr 08 '24 19:04 GuillaumeLaroucheUQAT

I can confirm this is not working in 1.33.6. I have an errorComponent set in the root route. Throwing an error in a beforeLoad handler in a pathless route does not render this error component instead I get a WSOD.

felipelube avatar May 21 '24 12:05 felipelube