T
TanStack•2mo ago
wise-white

.lazy() on a Route, with an error component is not displayed in case of error

Hey folks 👋 I want to check first here if it's a bug or a miscomprehension from me on the .lazy() api. If I have two routes: - one, no component / errorComponents, but a .lazy() with them - one with errorComponent directly in the route definition Only the one directly in the route definition will be shown when the route is in error state (like in a throw from a beforeLoad). From my (maybe limited) understanding, .lazy() is only about chunk splitting, and I would assume the errorComponent would be displayed. Is that a bug, or expected behaviour ? Reproduction: https://stackblitz.com/edit/tanstack-router-wiqzauc7?file=src%2Fmain.tsx
Nicolas Beaussart
StackBlitz
Router lazy error reproduction - StackBlitz
Run official live example code for Router Quickstart, created by Tanstack on StackBlitz
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?