You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hot Module Replacement (HMR) is not functioning correctly when using Vite with Rolldown. The issue specifically affects pages in the "routes" folder, while components outside of route files work but experience slow HMR performance.
Set up a project with Vite + Rolldown "vite": "npm:rolldown-vite@latest"
Create routes in the routes folder
import{createFileRoute}from"@tanstack/react-router";exportconstRoute=createFileRoute("/$lang/hello")({component: Page,});functionPage(){return(<div>
Hello world
</div>);}
Make changes to route components. E.g change "Hello world" -> "Hello Bug"
Observe that HMR does not trigger. (But the console detect HMR)
Make changes to components outside routes folder
Observe slow HMR performance
Expected behavior
HMR should work normally for all files including those in the routes folder
HMR should have fast refresh times similar to standard Vite
It's annoying because we don't know where it comes from when it appears.
In my case, I migrated from NextJS to TanStack Router, and I was using vite rolldown, which worked with NextJS. But that caused me problems here but it took me a long time to understand that it was the roll down that was the problem..
Which project does this relate to?
Router
Describe the bug
Hot Module Replacement (HMR) is not functioning correctly when using Vite with Rolldown. The issue specifically affects pages in the "routes" folder, while components outside of route files work but experience slow HMR performance.
Your Example Website or App
https://github.com/Hardel-DW/tanstack-bug-hmr
Steps to Reproduce the Bug or Issue
"vite": "npm:rolldown-vite@latest"Expected behavior
HMR should work normally for all files including those in the routes folder
HMR should have fast refresh times similar to standard Vite
Screenshots or Videos
2025-09-02_13-22-57.mp4
Platform
@tanstack/react-router": "^1.131.31"vite": "npm:rolldown-vite@latest"Additional context
It's annoying because we don't know where it comes from when it appears.
In my case, I migrated from NextJS to TanStack Router, and I was using vite rolldown, which worked with NextJS. But that caused me problems here but it took me a long time to understand that it was the roll down that was the problem..