Check your vite.config.js file. Since you are using @vitejs/plugin-react, you should see something like this (plus any other configuration):

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    react({
      babel: {
        plugins: ['babel-plugin-macros', ... (plugins here)],
      },
    }),
  ],
});

In the plugin array, if you have reactRefresh(), this means you are using @vitejs/plugin-react-refresh as well as @vitejs/plugin-react. This is unnecessary since plugin-react has hot refresh built-in and customisable. It probably won't break your code as far as I know but you can safely delete it.

Answer from DCVDiego on Stack Overflow
🌐
npm
npmjs.com › package › @vitejs › plugin-react-refresh
@vitejs/plugin-react-refresh - npm
Provides [React Refresh](https://www.npmjs.com/package/react-refresh) support for Vite.. Latest version: 1.3.6, last published: 5 years ago. Start using @vitejs/plugin-react-refresh in your project by running `npm i @vitejs/plugin-react-refresh`. There are 63 other projects in the npm registry using @vitejs/plugin-react-refresh.
      » npm install @vitejs/plugin-react-refresh
    
Published   Jul 27, 2021
Version   1.3.6
Author   Evan You
🌐
npm
npmjs.com › package › @vitejs › plugin-react
@vitejs/plugin-react - npm
The default Vite plugin for React projects. enable Fast Refresh in development (requires react >= 16.9) ... // vite.config.js import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' export default defineConfig({ plugins: ...
      » npm install @vitejs/plugin-react
    
Published   Mar 13, 2026
Version   6.0.1
Author   Evan You
🌐
GitHub
github.com › vitejs › vite-plugin-react-refresh
GitHub - vitejs/vite-plugin-react-refresh: React Fast Refresh plugin for Vite
Provides React Fast Refresh support for Vite 1. This plugin is included by default in the create-vite-app React template.
Starred by 303 users
Forked by 16 users
Languages   TypeScript 100.0% | TypeScript 100.0%
🌐
CodeSandbox
codesandbox.io › examples › package › @vitejs › plugin-react-refresh
@vitejs/plugin-react-refresh examples - CodeSandbox
AboutProvides [React Refresh](https://www.npmjs.com/package/react-refresh) support for Vite.42,854Weekly Downloads
🌐
npm
npmjs.com › package › vite-plugin-react-refresh
vite-plugin-react-refresh - npm
Provide enhancements for @vitejs/plugin-react-refresh.. Latest version: 1.0.0, last published: 4 years ago. Start using vite-plugin-react-refresh in your project by running `npm i vite-plugin-react-refresh`. There are 0 other projects in the npm registry using vite-plugin-react-refresh.
      » npm install vite-plugin-react-refresh
    
Published   Jul 31, 2021
Version   1.0.0
Author   Jesse Feng
🌐
GitHub
github.com › vitejs › vite-plugin-react-refresh › blob › master › README.md
vite-plugin-react-refresh/README.md at master · vitejs/vite-plugin-react-refresh
Provides React Fast Refresh support for Vite 1. This plugin is included by default in the create-vite-app React template.
Author   vitejs
🌐
npm
npmjs.com › package › @vitejs › plugin-react-swc
@vitejs/plugin-react-swc - npm
Under the hood, this simply updates the React Fash Refresh runtime URL from /@react-refresh to http://localhost:3000/@react-refresh to ensure there is only one Refresh runtime across the whole application.
      » npm install @vitejs/plugin-react-swc
    
Published   Mar 12, 2026
Version   4.3.0
Author   Arnaud Barré
🌐
GitHub
github.com › vitejs › vite-plugin-react › blob › main › packages › plugin-react › README.md
vite-plugin-react/packages/plugin-react/README.md at main · vitejs/vite-plugin-react
The default Vite plugin for React projects. enable Fast Refresh in development (requires react >= 16.9) ... // vite.config.js import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' export default defineConfig({ plugins: ...
Author   vitejs
Find elsewhere
🌐
DeepWiki
deepwiki.com › vitejs › vite-plugin-react-refresh
vitejs/vite-plugin-react-refresh | DeepWiki
July 3, 2025 - This document covers `vite-plugin-react`, a Vite plugin that provides React Fast Refresh support for Vite 1 development servers. The plugin enables hot module replacement (HMR) for React components, p
🌐
jsDelivr
jsdelivr.com › package › npm › @vitejs › plugin-react-refresh
@vitejs/plugin-react-refresh CDN by jsDelivr - A CDN for npm and GitHub
July 27, 2021 - A free, fast, and reliable CDN for @vitejs/plugin-react-refresh. Provides [React Refresh](https://www.npmjs.com/package/react-refresh) support for Vite.
Published   Dec 29, 2020
🌐
GitHub
github.com › vitejs › vite-plugin-react
GitHub - vitejs/vite-plugin-react: The all-in-one Vite plugin for React projects. · GitHub
The all-in-one Vite plugin for React projects. Contribute to vitejs/vite-plugin-react development by creating an account on GitHub.
Starred by 1K users
Forked by 236 users
Languages   TypeScript 89.3% | JavaScript 6.1% | CSS 3.3% | HTML 1.2% | MDX 0.1%
🌐
Vite
v2.vitejs.dev › guide › features
Features | Vite
Vite provides an HMR API over native ESM. Frameworks with HMR capabilities can leverage the API to provide instant, precise updates without reloading the page or blowing away application state. Vite provides first-party HMR integrations for Vue Single File Components and React Fast Refresh.
🌐
GitHub
github.com › vitejs › vite-plugin-react › releases
Releases · vitejs/vite-plugin-react
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert · {{ message }} vitejs / vite-plugin-react Public ·
Author   vitejs
🌐
GitHub
github.com › vitejs › vite › issues › 3675
Expand "@vitejs/plugin-react-refresh" to allow class components and non-component exports · Issue #3675 · vitejs/vite
The solution that we first tried was to try to implement a Runtime workaround, by expanding the react-refresh/runtime itself with a function explained in this discussion. But the fix relies on the assumption that one can "inspect" the current and previous exports of "the module". But as of now, that's not the case with Vite, so we have to look for some other solution. That why we expanded the plugin in our local environment to handle class components with HMR.
🌐
Drupal
drupal.org › project › vite › issues › 3392517
Support @vitejs/plugin-react [#3392517] | Drupal.org
October 29, 2024 - It could allow providing a list of other libraries like in the default 'dependencies' section, but they would be attached only when running in the vite development mode. Then for this specific use case, in this module we could define a vite/plugin-react-refresh library that includes the script.
🌐
DeepWiki
deepwiki.com › vitejs › vite-plugin-react › 2.1-@vitejsplugin-react
@vitejs/plugin-react | vitejs/vite-plugin-react | DeepWiki
July 16, 2025 - This plugin enables key features for React development, including Fast Refresh (hot module replacement for React components), automatic JSX runtime transformation, and customizable Babel configuration.
🌐
GitHub
github.com › vitejs › vite-plugin-react › tree › main › packages › plugin-react
vite-plugin-react/packages/plugin-react at main · vitejs/vite-plugin-react
The default Vite plugin for React projects. enable Fast Refresh in development (requires react >= 16.9) ... // vite.config.js import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' export default defineConfig({ plugins: ...
Author   vitejs
🌐
Npm
npm.io › package › @vitejs › plugin-react-refresh
@vitejs/plugin-react-refresh NPM | npm.io
Provides React Refresh support for Vite. // vite.config.js import reactRefresh from '@vitejs/plugin-react-refresh' export default { plugins: [reactRefresh()] }
🌐
Npm
npm.io › package › @vitejs › plugin-react
@vitejs/plugin-react NPM | npm.io
The default Vite plugin for React projects. enable Fast Refresh in development (requires react >= 16.9) ... // vite.config.js import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' export default defineConfig({ plugins: [react()], })