From 2abecb71500e08f11e1686a57110afb71f625433 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Tue, 25 Apr 2023 15:26:27 +0200 Subject: [PATCH] feat(warn): improve infinite redirect warning message --- packages/router/src/router.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/router/src/router.ts b/packages/router/src/router.ts index 575c0bb7..8493484b 100644 --- a/packages/router/src/router.ts +++ b/packages/router/src/router.ts @@ -719,7 +719,7 @@ export function createRouter(options: RouterOptions): Router { : 1) > 30 ) { warn( - `Detected a possibly infinite redirection in a navigation guard when going from "${from.fullPath}" to "${toLocation.fullPath}". Aborting to avoid a Stack Overflow. This might break in production if not fixed.` + `Detected a possibly infinite redirection in a navigation guard when going from "${from.fullPath}" to "${toLocation.fullPath}". Aborting to avoid a Stack Overflow.\n Are you always returning a new location within a navigation guard? That would lead to this error. Only return when redirecting or aborting, that should fix this. This might break in production if not fixed.` ) return Promise.reject( new Error('Infinite redirect in navigation guard') -- 2.47.2