Open
Description
Related plugins
Describe the bug
Hot reload "fails" under a certain condition:
Consider the Vue component hierarchy
App
- Outer
- Inner
Both Outer
and Inner
imports a file service.js
. When running with npm run dev
, editing that file triggers hot reload which logs the following warning and error:
[Vue warn]: Unhandled error during execution of scheduler flush
at <Inner>
at <Outer>
at <App> runtime-core.esm-bundler.js:51:12
Uncaught (in promise) TypeError: parent is null
...
Besides the error being logged, I didn't observe anything actually breaking. Reproduced in Firefox and Chrome on macOS.
SSCCE
Based on scaffolding using npm create vite@latest
.
main.js
import App from './App.vue';
import { createApp } from 'vue';
createApp(App)
.mount('#app');
App.vue
import App from './App.vue';
import { createApp } from 'vue';
createApp(App)
.mount('#app');
Outer.vue
<script setup>
import './service.js';
import Inner from './Inner.vue';
</script>
<template>
<Inner/>
</template>
Inner.vue
<script setup>
import './service.js';
</script>
<template>
Contents...
</template>
service.js
: Anything...
Reproduction
https://github.com/bisgardo/vue-vite-hotreload-bug-example
Steps to reproduce
- Run
npm run dev
- Make any edit to
service.js
. - Observe warning and error being dumped in the Browser's console.
System Info
System:
OS: macOS 15.5
CPU: (11) arm64 Apple M3 Pro
Memory: 126.92 MB / 36.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.9.0 - ~/.asdf/installs/nodejs/22.9.0/bin/node
npm: 10.8.3 - ~/.asdf/installs/nodejs/22.9.0/bin/npm
Browsers:
Chrome: 137.0.7151.69
Safari: 18.5
npmPackages:
@vitejs/plugin-vue: 5.2.4 => 5.2.4
vite: 6.3.5 => 6.3.5
Used Package Manager
npm
Logs
[Vue warn]: Unhandled error during execution of scheduler flush
at <Inner>
at <Outer>
at <App> runtime-core.esm-bundler.js:51:12
Uncaught (in promise) TypeError: parent is null
insert runtime-dom.esm-bundler.js:28
processText runtime-core.esm-bundler.js:4774
patch runtime-core.esm-bundler.js:4688
componentUpdateFn runtime-core.esm-bundler.js:5353
run reactivity.esm-bundler.js:237
setupRenderEffect runtime-core.esm-bundler.js:5481
mountComponent runtime-core.esm-bundler.js:5256
processComponent runtime-core.esm-bundler.js:5209
patch runtime-core.esm-bundler.js:4727
componentUpdateFn runtime-core.esm-bundler.js:5433
run reactivity.esm-bundler.js:227
reload runtime-core.esm-bundler.js:529
callWithErrorHandling runtime-core.esm-bundler.js:199
flushJobs runtime-core.esm-bundler.js:408
promise callback*queueFlush runtime-core.esm-bundler.js:322
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.