Skip to content

Can't use errorComponent in createLazyFileRoute #1311

@umar006

Description

@umar006

Describe the bug

I tried to use errorComponent in createLazyFileRoute but the component didn't show up when an error happened from the loader. But when I put errorComponent in createFileRoute it's working like what I expected (the component shows up).

I want to know why it's like that because in https://tanstack.com/router/v1/docs/framework/react/guide/code-splitting, errorComponent is supported by the createLazyFileRoute

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-gtkrcc?file=src%2Froutes%2Findex.lazy.tsx

Steps to Reproduce the Bug or Issue

  1. open the example app in stackblitz
  2. uncomment errorComponent in createLazyFileRoute, the component not show up
  3. uncomment errorComponent in createFileRoute, the component show up

Expected behavior

I was expecting the 'errorComponent' to show up from the 'createLazyFileRoute'

Screenshots or Videos

No response

Platform

  • OS: Linux
  • Browser: Chrome
  • Version: 122.0.6261.111

Thank you

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