diff --git a/packages/runtime-core/src/scheduler.ts b/packages/runtime-core/src/scheduler.ts index 0407ff6357e..a2da389b1a0 100644 --- a/packages/runtime-core/src/scheduler.ts +++ b/packages/runtime-core/src/scheduler.ts @@ -1,4 +1,4 @@ -import { ErrorCodes, callWithErrorHandling } from './errorHandling' +import { ErrorCodes, callWithErrorHandling, handleError } from './errorHandling' import { isArray, NOOP } from '@vue/shared' import { ComponentInternalInstance, getComponentName } from './component' @@ -261,14 +261,16 @@ function checkRecursiveUpdates(seen: CountMap, fn: SchedulerJob) { if (count > RECURSION_LIMIT) { const instance = fn.ownerInstance const componentName = instance && getComponentName(instance.type) - throw new Error( + handleError( `Maximum recursive updates exceeded${ componentName ? ` in component <${componentName}>` : `` }. ` + `This means you have a reactive effect that is mutating its own ` + `dependencies and thus recursively triggering itself. Possible sources ` + `include component template, render function, updated hook or ` + - `watcher source function.` + `watcher source function.`, + null, + ErrorCodes.APP_ERROR_HANDLER ) return true } else {