[vite] hmr invalidate … Could not Fast Refresh. Export is incompatible.
Fast Refresh fell back to a full reload because the file exports non-components alongside components.
Seen on:
React
Meaning
Fast Refresh only works when a file exports React components. Exporting constants, hooks or context from the same file forces a reload (eslint-plugin-react-refresh warns about it).
Common causes
- File exports a component and a constant/hook/context
- Anonymous default export
- Class components
⚡ Quick fix
- Move non-component exports to separate files
- Name components (export default function Card())
Detailed fix by platform
React
- Split
UserContextanduseUserinto their own module next to the component
How to diagnose
- Exports — What else does the file export?
- Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026