-
-
Notifications
You must be signed in to change notification settings - Fork 195
Description
Describe the regression
Hot Module Replacement (HMR) is not functioning correctly when using Vite with Rolldown and TanStack router. The issue specifically affects pages in the "routes" folder, while components outside of route files work but experience slow HMR performance.
Copied from TanStack/router#5100
Reproduction
https://github.com/Hardel-DW/tanstack-bug-hmr
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
Actual Behavior
HMR is very slow.
Steps to Reproduce
-
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
System Info
-
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"
Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs and the Rolldown-related guide.
- Check that there isn't already an issue that reports the same regression to avoid creating a duplicate.
- Check that this is a concrete regression. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the regression.