watchEffect typing does not support async callback
Author: mitarCreated Dec 25, 2025Updated Sep 23, 2026
Labelsscope: types
Vue version
3.5.26
Link to minimal reproduction
Steps to reproduce
Observe the type defined on OnCleanup which is used by:
export type WatchEffect = (onCleanup: OnCleanup) => voidObserve that the callback cannot return a promise, so async functions are not allowed by typing.
On the other hand, current documentation does use async and even "async" behavior has an important tip at the end of this section.
What is expected?
Type like:
export type WatchEffect = (onCleanup: OnCleanup) => Promise<void> | voidWhat is actually happening?
When type checking using eslint, it complains:
Promise returned in function argument where a void return was expected
@typescript-eslint/no-misused-promisesSystem Info
Any additional comments?
This has been previously reported in https://github.com/vuejs/composition-api/issues/648 and based on recent comments it is still problematic.
Source: vuejs/core