Which project does this relate to?
Router
Describe the bug
When using react router v1.170.3 if in my __root.tsx file if I use createRootRouteWithContext to create my route Vite fast refresh doesn't work.
I get the error:
[vite] (client) hmr update /src/css/index.css, /src/routes/__root.tsx
[vite] (client) hmr invalidate /src/routes/__root.tsx Could not Fast Refresh ("Route" export is incompatible). Learn more at https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react#consistent-components-exports
If I use createRootRoute I don't see the error in the terminal.
Complete minimal reproducer
https://stackblitz.com/edit/github-g9yc4r8q-58ibupra?file=src%2Froutes%2F__root.tsx
Steps to Reproduce the Bug
- Go to the stackblitz that I created
- Update anything in
__root.tsx and save the file.
- You will see the error in the terminal.
Expected behavior
I shouldn't see that error in the terminal.
Screenshots or Videos
Platform
- Router Version: v1.170.3
- OS: macOS
- Browser: [e.g. Chrome, Safari, Firefox]
- Browser Version: [e.g. 91.1]
- Bundler: vite
- Bundler Version: [e.g. 7.0.0]
Additional context
Seems to be similar to a problem reported in the past: #3815.
Which project does this relate to?
Router
Describe the bug
When using react router v1.170.3 if in my
__root.tsxfile if I usecreateRootRouteWithContextto create my route Vite fast refresh doesn't work.I get the error:
If I use
createRootRouteI don't see the error in the terminal.Complete minimal reproducer
https://stackblitz.com/edit/github-g9yc4r8q-58ibupra?file=src%2Froutes%2F__root.tsx
Steps to Reproduce the Bug
__root.tsxand save the file.Expected behavior
I shouldn't see that error in the terminal.
Screenshots or Videos
Platform
Additional context
Seems to be similar to a problem reported in the past: #3815.