Skip to content
Source
Sign inSign up
TanStack/router

HMR updates not applied for __root.tsx changes (requires full reload) #6195

Send to my agent
Closedlongfellowone(GitHub profile, opens in a new tab) opened this issue 1 comment

Which project does this relate to?

Router

Describe the bug

HMR updates are sent but not applied for changes to __root.tsx. Vite logs show the HMR update is sent (hmr update /src/routes/__root.tsx), but the browser does not reflect the changes. A full page reload is required.

Your Example Website or App

See below

Steps to Reproduce the Bug or Issue

  1. Create fresh app with npx create-tsrouter-app@latest --template file-router
  2. Run npm run dev
  3. Open http://localhost:3000 in browser
  4. Edit src/routes/__root.tsx - add <h1>Test</h1> before <Outlet />
  5. Save the file
  6. Observe: Vite logs hmr update /src/routes/__root.tsx but page does not update
  7. Manually refresh - now the change appears

Expected behavior

Changes to __root.tsx should hot-reload without requiring a full page refresh, similar to other route files.

Screenshots or Videos

No response

Platform

  • Router / Start Version: 1.132.0
  • OS: macOS
  • Browser: Chrome
  • Browser Version: 143.0.0.0
  • Bundler: Vite
  • Bundler Version: 7.3.0

Additional context

No response

  1. 📝 CodeRabbit Plan Mode

    Generate an implementation plan and prompts that you can use with your favorite coding agent.

    • Create Plan
    Examples

    🔗 Similar Issues

    Possible Duplicates

    • 3917

    Related Issues

    🔗 Related PRs
  2. TanStack/router#5317 - fix: prevent HMR to throw error about entrypoints [merged] TanStack/router#5389 - fix: navigate() respects rewrites when reloadDocument=true [merged] TanStack/router#5533 - docs: Update migrate-from-next-js.md [merged] TanStack/router#5686 - fix(router-core): Catch errors thrown during hydrate [merged] TanStack/router#5710 - fix: route HMR handling [merged]

    👤 Suggested Assignees


    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord or schedule a call!

  • Sign in to join this conversation.