Skip to content

Default error component does not catch - Failed to fetch dynamically imported module #6107

@eylamk

Description

@eylamk

Which project does this relate to?

Router

Describe the bug

When failed to fetch dynamically imported module error is thrown,
the default error component (defaultErrorComponent in the createRouter) does not catch it.
Then an error is thrown in the console from the routeTree.gen.ts mostly on index.lazy files.

Your Example Website or App

Steps to Reproduce the Bug or Issue

  1. from devtools disable network - set yourself as offline.
  2. hover over a button that navigates to a route.
  3. the error will be thrown.

Expected behavior

As a user I expect that the defaultErrorComponent will catch this error and decide how to handle it, so I will be able to mute/ ignore it/ reload the page.

Screenshots or Videos

Image

Platform

  • Router / Start Version: [e.g. 1.121.0]
  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Browser Version: [e.g. 91.1]
  • Bundler: [e.g. vite]
  • Bundler Version: [e.g. 7.0.0]

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions