-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
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
- Set up a project with Vite + Rolldown
"vite": "npm:rolldown-vite@latest"
- Create routes in the routes folder
import { createFileRoute } from "@tanstack/react-router";
export const Route = createFileRoute("/$lang/hello")({
component: Page,
});
function Page() {
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
Screenshots or Videos
2025-09-02_13-22-57.mp4
Platform
- Router:
@tanstack/react-router": "^1.131.31
- OS: Windows
- Browser: Chrome, Firefox and Zen
- Browser Version: 139 For Chrome
- Bundler: Vite Rolldown
- Bundler Version:
"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..
nandcello, checkerschaf and lbartroli
Metadata
Metadata
Assignees
Labels
No labels