Skip to content

HMR not working in ServerComponents using the Data Mode template #170

@bskimball

Description

@bskimball

When updating a ServerComponent in Dev mode, vite sends "rsc:update" to the browser to signify a change. React Router tries to re-validate using window.__router.revalidate(), but throws an error that window.__router is undefined

entry.browser.tsx:50 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'revalidate')
    at entry.browser.tsx:50:62
    at client:132:48
    at Array.map (<anonymous>)
    at HMRClient.notifyListeners (client:132:36)
    at handleMessage (client:961:23)
    at Object.promise (client:490:43)
    at Queue.dequeue (client:516:10)
    at client:518:12
    at <anonymous>

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