# [vite] hmr invalidate … Could not Fast Refresh. Export is incompatible.

**Code:** `Could not Fast Refresh` · **Category:** React · **Seen on:** React

Fast Refresh fell back to a full reload because the file exports non-components alongside components.

## 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

1. Move non-component exports to separate files
2. Name components (export default function Card())

## Detailed fix by platform

### React

1. Split `UserContext` and `useUser` into their own module next to the component

## How to diagnose

1. **Exports** — What else does the file export?
2. **Recent change** — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/react/could-not-fast-refresh)
