From dd0ea5bd412ac786a8d18bfdf37a54fc582d5b67 Mon Sep 17 00:00:00 2001 From: Tim Pechersky Date: Thu, 5 Aug 2021 18:03:42 +0800 Subject: [PATCH] try 2 --- frontend/pages/index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/pages/index.js b/frontend/pages/index.js index a90f2dd7..0793ecd0 100644 --- a/frontend/pages/index.js +++ b/frontend/pages/index.js @@ -117,10 +117,12 @@ const Homepage = () => { router.nextRouter.asPath.slice(0, 2) !== "/#" && router.nextRouter.asPath.slice(0, 11) !== "/index.html" ) { - console.log("redirect attempt.."); - router.replace(router.nextRouter.asPath, router.nextRouter.asPath, { - shallow: false, - }); + console.warn("redirect attempt.."); + if (typeof window !== "undefined") { + router.replace(router.nextRouter.asPath, router.nextRouter.asPath, { + shallow: false, + }); + } } }, [isInit, router]);