From 9940be16075a52ed507a58d6b4ce364555cb6598 Mon Sep 17 00:00:00 2001 From: Luke Vella Date: Thu, 18 Aug 2022 16:11:19 +0100 Subject: [PATCH] Vercel middleware bug (#293) * Remove rewrite * Revert change to middleware --- next.config.js | 4 ---- src/middleware.ts | 6 +----- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/next.config.js b/next.config.js index 1e1c831e4..3e21d9f24 100644 --- a/next.config.js +++ b/next.config.js @@ -42,10 +42,6 @@ const moduleExports = { source: "/", destination: "/home", }, - { - source: "/:urlId", - destination: "/poll?urlId=:urlId", - }, { source: "/p/:urlId", destination: "/poll?urlId=:urlId", diff --git a/src/middleware.ts b/src/middleware.ts index 70649dce5..a6d719a3d 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -39,11 +39,7 @@ export function middleware({ headers, cookies, nextUrl }: NextRequest) { } } - // TODO (Luke Vella) [2022-08-18]: There seems to be a bug on vercel that - // results in the component being remounted when doing NextResponse.next() rather - // than loading the correct component. - // return NextResponse.next(); - return NextResponse.rewrite(newUrl); + return NextResponse.next(); } export const config = {