diff --git a/packages/runtime-core/src/apiWatch.ts b/packages/runtime-core/src/apiWatch.ts index 4a8248aa..9f530661 100644 --- a/packages/runtime-core/src/apiWatch.ts +++ b/packages/runtime-core/src/apiWatch.ts @@ -138,8 +138,7 @@ function doWatch( let cleanup: Function const registerCleanup: CleanupRegistrator = (fn: () => void) => { - // TODO wrap the cleanup fn for error handling - cleanup = runner.onStop = () => { + cleanup = runner.options.onStop = () => { callWithErrorHandling(fn, instance, ErrorCodes.WATCH_CLEANUP) } }