Non-remix exports break Vite's HMR #676
Replies: 4 comments 4 replies
-
Just ran
|
Beta Was this translation helpful? Give feedback.
-
This is not true: Line 379 in c047d75 That said, it does export |
Beta Was this translation helpful? Give feedback.
-
I tried it like this and HMR still doesn't work. |
Beta Was this translation helpful? Give feedback.
-
@andrecasal have you resolved this issue? I also encountered it and the problem was in Express integration with Vite. I do not use Epic Stack directly so I am not sure if the problem is the same. |
Beta Was this translation helpful? Give feedback.
-
Vite's HMR only works when a file exports a component and nothing else. Because Remix knows which exports belong to Remix (handle, links, loader, action, etc), it allows us to still export these things from within a route.
However, the
root.tsx
contains anexport function ThemeSwitch()
, which isn't a standard Remix export.Won't this break HMR? According to Remix's HMR docs, it should.
After upgrading to Vite, I lost Live Reload/HMR/HDR. I'm not sure exports like these are the culprits, but wanted to ask before I go digging around. Manual refresh still works.
Beta Was this translation helpful? Give feedback.
All reactions