Related plugins
Describe the bug
If @vitejs/plugin-vue and @vitejs/plugin-react live in the same Vite config,
some of my <script setup lang="ts"> Vue components started getting React Fast
Refresh code ($RefreshSig$ / $RefreshReg$) injected into them.
That's harmless on pages that also load React, but our app has Vue-only pages
(server-rendered, no @viteReactRefresh runtime). On those, dev blows up with:
Uncaught ReferenceError: $RefreshSig$ is not defined
It's dev-only — production builds are fine.
Reproduction
https://github.com/KoukiOhno/plugin-vue-react-refresh-repro
Steps to reproduce
It doesn't happen on every SFC, which is why it was tricky to pin down. It needs
all three of these at once:
- plugin-react is present (it sets
jsx.refresh: true on the global config.oxc)
- the SFC uses
<script setup lang="ts"> (this is what sends it down the
transformWithOxc path)
- the script has something oxc's refresh pass thinks is a hook/component
In practice (3) just means a use* call. Vue composables like useSlots(),
useRoute(), useStore() all trigger it, since oxc keys off the use prefix.
A bare SFC with no such call slips through untouched — that's why the repro
deliberately calls useSlots().
System Info
System:
OS: Linux 6.18 Ubuntu 24.04.2 LTS
CPU: (12) x64 Intel(R) Core(TM) i7-14700K
Shell: /bin/bash
Binaries:
Node: 24.14.1
npm: 11.11.0
pnpm: 10.29.3
Browsers:
Chrome: 149.0.7827.155
npmPackages:
@vitejs/plugin-react: 6.0.2 => 6.0.2
@vitejs/plugin-vue: 6.0.6 => 6.0.6 (also repros on 6.0.7)
vite: 8.0.16 => 8.0.16
vue: 3.5.35
Used Package Manager
pnpm
Logs
No response
Validations
Related plugins
plugin-vue
plugin-vue-jsx
Describe the bug
If
@vitejs/plugin-vueand@vitejs/plugin-reactlive in the same Vite config,some of my
<script setup lang="ts">Vue components started getting React FastRefresh code (
$RefreshSig$/$RefreshReg$) injected into them.That's harmless on pages that also load React, but our app has Vue-only pages
(server-rendered, no
@viteReactRefreshruntime). On those, dev blows up with:It's dev-only — production builds are fine.
Reproduction
https://github.com/KoukiOhno/plugin-vue-react-refresh-repro
Steps to reproduce
It doesn't happen on every SFC, which is why it was tricky to pin down. It needs
all three of these at once:
jsx.refresh: trueon the globalconfig.oxc)<script setup lang="ts">(this is what sends it down thetransformWithOxcpath)In practice (3) just means a
use*call. Vue composables likeuseSlots(),useRoute(),useStore()all trigger it, since oxc keys off theuseprefix.A bare SFC with no such call slips through untouched — that's why the repro
deliberately calls
useSlots().System Info
Used Package Manager
pnpm
Logs
No response
Validations