From 6ca545f875c2b44c85a66285499465bd68d15d01 Mon Sep 17 00:00:00 2001 From: Jonas Buntinx Date: Fri, 11 Sep 2020 11:01:30 +0900 Subject: [PATCH] Fixed redirect for index with getServerSideProps --- lib/allNextJsPages.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/allNextJsPages.js b/lib/allNextJsPages.js index 4f57d35..4de738b 100644 --- a/lib/allNextJsPages.js +++ b/lib/allNextJsPages.js @@ -55,7 +55,7 @@ const getAllPages = () => { // the JSON data to the Netlify Function. const dataRoute = dataRoutes.find(({ page }) => page === route); if (dataRoute) - alternativeRoutes.push(join("/_next/data", buildId, `${route}.json`)); + alternativeRoutes.push(join("/_next/data", buildId, `${route === "/" ? "/index" : route}.json`)); pages.push(new Page({ route, type, filePath, alternativeRoutes })); });