Thanks to visit codestin.com
Credit goes to github.com

Skip to content

RouterProvider - Cannot read properties of undefined #6532

@cjoecker

Description

@cjoecker

Which project does this relate to?

Router

Describe the bug

When the RouterProvider is added anywhere in the Router as follows:
<RouterProvider router={getRouter()} context={{ isLoading: true }} />,
it throws this error
TypeError: Cannot read properties of undefined (reading 'subscribe')

Your Example Website or App

https://github.com/cjoecker/tanstack-error-reproduction-2

Steps to Reproduce the Bug or Issue

  1. Start the project with npm run dev
  2. See the server console

Expected behavior

The RouterProvider don't throw any error

Screenshots or Videos

No response

Platform

See reproduction project

Additional context

Line with error is here:

https://github.com/cjoecker/tanstack-error-reproduction-2/blob/5ea9366838bc4d929c05bf8b83d8f54fdec173d3/src/routes/__root.tsx#L43C8-L43C78

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